Using the latest RN pr v0.56.0-rc
When running 'react-native run-android', I get an error saying it doesn't recognize the import command in clipEntry.js, line 30.
...\node_modules\react-native\local-cli\cliEntry.js:30
import type { CommandT } from './commands';
^^^^^^
SyntaxError: Unexpected token import
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:616:28)
at Module._compile (Y:\React-Native\trivia-mobile-n\node_modules\pirates\lib\index.js:91:24)
at Module._extensions..js (module.js:663:10)
at Object.newLoader [as .js] (Y:\React-Native\trivia-mobile-n\node_modules\pirates\lib\index.js:96:7)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
my devDependencies -
"devDependencies": {
"@babel/core": "^7.0.0-beta.49",
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "^23.0.1",
"babel-preset-react-native": "^5.0.0",
"babel-preset-react-native-stage-0": "^1.0.1",
"fs-extra": "^4.0.2",
"jest": "22.0.6",
"react-test-renderer": "16.2.0",
"replace-in-file": "^3.0.0"
},
Imho, this happens because https://github.com/facebook/react-native/issues/19666~~ After further investigation, I think these are two seperate issues.
We are automatically closing this issue because it does not appear to follow any of the provided issue templates.
Please make use of the bug report template to let us know about a reproducible bug or regression in the core React Native library.
If you'd like to start a discussion, check out https://discuss.reactjs.org or follow the discussion template.
I don't think a template would be relevant here, since this is a general error that occurs with a simple cli 'run-android' command.
This seems to be an issue with how babel 7 resolves paths on windows. There is some path seperator replacement in https://github.com/facebook/metro/blob/master/packages/metro-babel-register/src/babel-register.js. If you remove both occurences of .replace(/\\/g, '/') the cliEntry error is gone. However, there seems to be an issue with haste module resolving on windows then.
Might be a react-native issue, might be a metro issue or might be a babel issue. Anyways, v0.56.0-rc is broken on windows.
@hramos Please re-open this issue. Although the template is not provided, this is a major blocking issue for any react-native development on Windows, including react-native-windows apps.
Hey @yakirbu, what if you fill in the template, would the bot be pleased? Just to fool it.
@rozele can you submit a new issue in that case? I see no reason why the template cannot be used here.
I think there is already some initiative to fix this issue here:
Duplicate of #19654
(locking to prevent spam leaking from #20015)
Most helpful comment
@hramos Please re-open this issue. Although the template is not provided, this is a major blocking issue for any react-native development on Windows, including react-native-windows apps.