Skip to content

Unexpected token (./assets/js/login.jsx) #15

@fohrloop

Description

@fohrloop

Hello,

I am trying to install this as instructed here.

When running npm run build, I got this error:

PS C:\git stuff\django-react-auth> npm run build

> django_react_auth@1.0.0 build C:\git stuff\django-react-auth
> webpack --config webpack.config.js

Hash: 2795ec02dd9c3597dfa1
Version: webpack 1.15.0
Time: 859ms
  Asset     Size  Chunks             Chunk Names
main.js  1.13 MB       0  [emitted]  main
    + 226 hidden modules

ERROR in ./assets/js/login.jsx
Module build failed: SyntaxError: C:/git stuff/django-react-auth/assets/js/login.jsx: Unexpected token, expected , (15:4)

  13 |       }
  14 |
> 15 |     handleSubmit: function(e) {
     |     ^
  16 |         e.preventDefault()
  17 |
  18 |         var username = this.refs.username.value

 @ ./assets/js/index.jsx 5:12-30

I got the build working by changing this

   getInitialState = () => {
        return {
          login_error: false
        }
      }

(note the missing comma)
to this

    getInitialState: function() {
        return {
          login_error: false
        }
      },

in the ./assets/js/login.jsx. Do you think this is a bug, or just a matter of my configuration?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions