Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

You can only use Class Properties when the 'classProperties' plugin is enabled #12545

Closed
huxinmin opened this issue Feb 23, 2017 · 3 comments
Closed
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@huxinmin
Copy link

I use react-native init preoject, and it failed and I dont know why:

├─ yallist@2.0.0
├─ yargs-parser@4.2.1
└─ yargs@6.6.0
Done in 338.50s.
G:\TestReact\node_modules\babel-core\lib\transformation\file\index.js:600
throw err;
^

SyntaxError: G:/TestReact/node_modules/react-native/packager/react-packager/src/node-haste/index.js: You can only use Class Properties when the 'classProperties' plugin is enabled. (389:2)
387 | }
388 |

389 | static Cache;
| ^
390 | static Module;
391 | static Polyfill;
392 | static getAssetDataFromName;
at Parser.pp$5.raise (G:\TestReact\node_modules\babylon\lib\index.js:4380:13)
at Parser.pp$1.parseClassProperty (G:\TestReact\node_modules\babylon\lib\index.js:2508:10)
at Parser.parseClassProperty (G:\TestReact\node_modules\babylon\lib\index.js:5947:20)
at Parser.pp$1.parseClassBody (G:\TestReact\node_modules\babylon\lib\index.js:2424:34)
at Parser.pp$1.parseClass (G:\TestReact\node_modules\babylon\lib\index.js:2361:8)
at Parser.pp$1.parseStatement (G:\TestReact\node_modules\babylon\lib\index.js:1798:19)
at Parser.parseStatement (G:\TestReact\node_modules\babylon\lib\index.js:5719:22)
at Parser.pp$1.parseBlockBody (G:\TestReact\node_modules\babylon\lib\index.js:2223:21)
at Parser.pp$1.parseTopLevel (G:\TestReact\node_modules\babylon\lib\index.js:1733:8)
at Parser.parse (G:\TestReact\node_modules\babylon\lib\index.js:1628:17)

@mcmillan
Copy link

Please see #12542.

@huxinmin
Copy link
Author

I run this in windows and My nodejs version is v6.9.5,
react-native-cli: 2.0.1

@brentvatne
Copy link
Collaborator

@huxinmin - as @mcmillan pointed out, #12542 seems to solve this problem

@facebook facebook locked as resolved and limited conversation to collaborators May 24, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

4 participants