1

I'm trying to debug my android app with react native v0.66.1 and react native tools v1.8.1 in vsCode. But after running the app and attach to packager, or launch in debug mode, I got this error com.facebook.react.commot.JavascriptException: Invalid or unexpected token.

enter image description here

1 Answer 1

1

update babel.config.js of your project : (assume your metro-react-native-babel-preset is 0.58.0) from:

module.exports = {
   presets: ['module:metro-react-native-babel-preset'],
};

to:

module.exports = {
   presets: [['module:metro-react-native-babel-preset', {
        unstable_disableES6Transforms: true
    }]],
};

finally run yarn start --reset-cache to restart app.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.