-
Notifications
You must be signed in to change notification settings - Fork 10
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
bundling failed: SyntaxError #2
Comments
@anchengjian, if you look at the code, it should fail and say |
@anchengjian, did you resolve your issue? I don't know what you mean by the 😕emoji. Have you tried correcting your |
I checked my local code and there were no spelling errors. I just misspelled it in this issue. |
I create a project,that can show this error # install
$ yarn
# start
$ yarn start --reset-cache
# Trigger compilation
$ curl http://127.0.0.1:8081/index.bundle?platform=ios |
@anchengjian. Thanks for the example project. #3 also has an error with React Native and your project really helped since I am not familiar with React Native. I found out that both your app and an ejected app created with expo will transpile certain react-native files inside You are using I noticed that I found out that expo and I noticed that The reason you are getting the error is that A quick solution would be to do the following: #.babelrc
{
"presets": ["module:metro-react-native-babel-preset"],
"overrides": [
{
"test": ["*.ts", "*.tsx"],
"plugins": [
[
"const-enum",
{
"transform": "removeConst"
}
]
]
}
]
} Or if you are using babel.config.js, you can optionally use regex (although the array option works the same): #babel.config.js
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
overrides: [
{
test: /\.tsx?$/,
plugins: [
[
'const-enum',
{
transform: 'removeConst',
},
],
],
},
],
}; In my spare time, maybe I will create a preset to do this for you automatically. Maybe called Let me know if this resolves your issue, and I can close this. |
error info
version info
and
.babelrc
When I remove
const-enum
, everything is ok 😢😢😢The text was updated successfully, but these errors were encountered: