can not run - unexpected token
See original GitHub issueDownloaded and set up as instructed. Does not run on my system, giving me this error:
@ start /Users/elliot/reactwork babel-node --eval “require(‘./tools/start’)().catch(err => console.log(err.stack))”
[12:16:11] Starting ‘build’… [12:16:11] Starting ‘clean’… [12:16:11] Finished ‘clean’ after 18ms [12:16:11] Starting ‘copy’… [12:16:11] Finished ‘copy’ after 8ms [12:16:11] Starting ‘bundle’… Child Time: 2975ms
ERROR in ./pages/500.js
Module build failed: SyntaxError: /Users/elliot/reactwork/pages/500.js: Unexpected token (11:19)
9 | export default class extends Component {
10 |
> 11 | static propTypes = {
| ^
12 | error: PropTypes.instanceOf(Error),
13 | };
14 |
at Parser.pp.raise (/Users/elliot/reactwork/node_modules/babel-core/node_modules/babylon/lib/parser/location.js:24:13)
at Parser.pp.unexpected (/Users/elliot/reactwork/node_modules/babel-core/node_modules/babylon/lib/parser/util.js:82:8)
at Parser.pp.parseClassProperty (/Users/elliot/reactwork/node_modules/babel-core/node_modules/babylon/lib/parser/statement.js:624:61)
at Parser.parseClassProperty (/Users/elliot/reactwork/node_modules/babel-core/node_modules/babylon/lib/plugins/flow.js:797:20)
at Parser.pp.parseClass (/Users/elliot/reactwork/node_modules/babel-core/node_modules/babylon/lib/parser/statement.js:567:32)
at Parser.pp.parseExprAtom (/Users/elliot/reactwork/node_modules/babel-core/node_modules/babylon/lib/parser/expression.js:405:19)
at Parser.parseExprAtom (/Users/elliot/reactwork/node_modules/babel-core/node_modules/babylon/lib/plugins/jsx/index.js:412:22)
at Parser.pp.parseExprSubscripts (/Users/elliot/reactwork/node_modules/babel-core/node_modules/babylon/lib/parser/expression.js:236:19)
at Parser.pp.parseMaybeUnary (/Users/elliot/reactwork/node_modules/babel-core/node_modules/babylon/lib/parser/expression.js:217:19)
at Parser.pp.parseExprOps (/Users/elliot/reactwork/node_modules/babel-core/node_modules/babylon/lib/parser/expression.js:163:19)
@ ./app.js 41:11-36
ERROR in ./components/Link/Link.js
Module build failed: SyntaxError: /Users/elliot/reactwork/components/Link/Link.js: Unexpected token (21:19)
19 | class Link extends Component {
20 |
> 21 | static propTypes = {
| ^
22 | to: PropTypes.string.isRequired,
23 | children: PropTypes.element.isRequired,
24 | state: PropTypes.object,
at Parser.pp.raise (/Users/elliot/reactwork/node_modules/babel-core/node_modules/babylon/lib/parser/location.js:24:13)
at Parser.pp.unexpected (/Users/elliot/reactwork/node_modules/babel-core/node_modules/babylon/lib/parser/util.js:82:8)
at Parser.pp.parseClassProperty (/Users/elliot/reactwork/node_modules/babel-core/node_modules/babylon/lib/parser/statement.js:624:61)
at Parser.parseClassProperty (/Users/elliot/reactwork/node_modules/babel-core/node_modules/babylon/lib/plugins/flow.js:797:20)
at Parser.pp.parseClass (/Users/elliot/reactwork/node_modules/babel-core/node_modules/babylon/lib/parser/statement.js:567:32)
at Parser.pp.parseStatement (/Users/elliot/reactwork/node_modules/babel-core/node_modules/babylon/lib/parser/statement.js:84:19)
at Parser.parseStatement (/Users/elliot/reactwork/node_modules/babel-core/node_modules/babylon/lib/plugins/flow.js:621:22)
at Parser.pp.parseTopLevel (/Users/elliot/reactwork/node_modules/babel-core/node_modules/babylon/lib/parser/statement.js:30:21)
at Parser.parse (/Users/elliot/reactwork/node_modules/babel-core/node_modules/babylon/lib/parser/index.js:70:17)
at Object.parse (/Users/elliot/reactwork/node_modules/babel-core/node_modules/babylon/lib/index.js:45:50)
@ ./components/Navigation/Navigation.js 21:12-30
Child Time: 2319ms Asset Size Chunks Chunk Names app.node.js 33.2 kB 0 [emitted] main
ERROR in ./pages/500.js
Module build failed: SyntaxError: /Users/elliot/reactwork/pages/500.js: Unexpected token (11:19)
9 | export default class extends Component {
10 |
> 11 | static propTypes = {
| ^
12 | error: PropTypes.instanceOf(Error),
13 | };
14 |
at Parser.pp.raise (/Users/elliot/reactwork/node_modules/babel-core/node_modules/babylon/lib/parser/location.js:24:13)
at Parser.pp.unexpected (/Users/elliot/reactwork/node_modules/babel-core/node_modules/babylon/lib/parser/util.js:82:8)
at Parser.pp.parseClassProperty (/Users/elliot/reactwork/node_modules/babel-core/node_modules/babylon/lib/parser/statement.js:624:61)
at Parser.parseClassProperty (/Users/elliot/reactwork/node_modules/babel-core/node_modules/babylon/lib/plugins/flow.js:797:20)
at Parser.pp.parseClass (/Users/elliot/reactwork/node_modules/babel-core/node_modules/babylon/lib/parser/statement.js:567:32)
at Parser.pp.parseExprAtom (/Users/elliot/reactwork/node_modules/babel-core/node_modules/babylon/lib/parser/expression.js:405:19)
at Parser.parseExprAtom (/Users/elliot/reactwork/node_modules/babel-core/node_modules/babylon/lib/plugins/jsx/index.js:412:22)
at Parser.pp.parseExprSubscripts (/Users/elliot/reactwork/node_modules/babel-core/node_modules/babylon/lib/parser/expression.js:236:19)
at Parser.pp.parseMaybeUnary (/Users/elliot/reactwork/node_modules/babel-core/node_modules/babylon/lib/parser/expression.js:217:19)
at Parser.pp.parseExprOps (/Users/elliot/reactwork/node_modules/babel-core/node_modules/babylon/lib/parser/expression.js:163:19)
@ ./app.js 39:11-36
ERROR in ./components/Link/Link.js
Module build failed: SyntaxError: /Users/elliot/reactwork/components/Link/Link.js: Unexpected token (21:19)
19 | class Link extends Component {
20 |
> 21 | static propTypes = {
| ^
22 | to: PropTypes.string.isRequired,
23 | children: PropTypes.element.isRequired,
24 | state: PropTypes.object,
at Parser.pp.raise (/Users/elliot/reactwork/node_modules/babel-core/node_modules/babylon/lib/parser/location.js:24:13)
at Parser.pp.unexpected (/Users/elliot/reactwork/node_modules/babel-core/node_modules/babylon/lib/parser/util.js:82:8)
at Parser.pp.parseClassProperty (/Users/elliot/reactwork/node_modules/babel-core/node_modules/babylon/lib/parser/statement.js:624:61)
at Parser.parseClassProperty (/Users/elliot/reactwork/node_modules/babel-core/node_modules/babylon/lib/plugins/flow.js:797:20)
at Parser.pp.parseClass (/Users/elliot/reactwork/node_modules/babel-core/node_modules/babylon/lib/parser/statement.js:567:32)
at Parser.pp.parseStatement (/Users/elliot/reactwork/node_modules/babel-core/node_modules/babylon/lib/parser/statement.js:84:19)
at Parser.parseStatement (/Users/elliot/reactwork/node_modules/babel-core/node_modules/babylon/lib/plugins/flow.js:621:22)
at Parser.pp.parseTopLevel (/Users/elliot/reactwork/node_modules/babel-core/node_modules/babylon/lib/parser/statement.js:30:21)
at Parser.parse (/Users/elliot/reactwork/node_modules/babel-core/node_modules/babylon/lib/parser/index.js:70:17)
at Object.parse (/Users/elliot/reactwork/node_modules/babel-core/node_modules/babylon/lib/index.js:45:50)
@ ./components/Navigation/Navigation.js 21:12-30
[12:16:14] Finished ‘bundle’ after 2997ms [12:16:14] Starting ‘render’… Error: Cannot find module “…/Link” at webpackMissingModule (/Users/elliot/reactwork/build/app.node.js:297:79) at Object.module.exports.Object.defineProperty.value (/Users/elliot/reactwork/build/app.node.js:297:163) at webpack_require (/Users/elliot/reactwork/build/app.node.js:21:30) at Object.module.exports.Object.defineProperty.value (/Users/elliot/reactwork/build/app.node.js:251:21) at webpack_require (/Users/elliot/reactwork/build/app.node.js:21:30) at Object.<anonymous> (/Users/elliot/reactwork/build/app.node.js:78:27) at webpack_require (/Users/elliot/reactwork/build/app.node.js:21:30) at module.exports.Object.defineProperty.value (/Users/elliot/reactwork/build/app.node.js:41:18) at Object.<anonymous> (/Users/elliot/reactwork/build/app.node.js:42:11) at Module._compile (module.js:460:26)
Issue Analytics
- State:
- Created 8 years ago
- Comments:7 (1 by maintainers)
Top GitHub Comments
I don’t think you can set a static property on a ES6 class like this: https://github.com/koistya/react-static-boilerplate/blob/master/components/Link/Link.js#L21
It should be:
Easy fix, but this component should just be replaced by
rackt/react-router
imho.Update: I was wrong. I didn’t realize this project was using ES6+ instead of ES6.
Hi there, I have the same problem. I cloned RSB yesterday (master)
I get the warning on all (even the included) components.
OS: Windows 10 Node: 6.4