Issue
I am trying to open a web-based React-app on chrome on an Android emulator but am getting the following error: Unhandled Runtime Error Uncaught SyntaxError: Unexpected Token .
The same app can be opened through chrome on localhost or through mobile chrome on my smartphone but not on the android emulator. Any thoughts why this is happening and how it could be solved?
Local setup:
- React app (with Typescript)
- Snowpack dev server
- Android Studio - Android Emulator (Pixel 4 API 29 / Android 10.0)
- Chrome browser
Solution
If anyone happens to have the same problem, the solution is to add the following packages to both package.json and babel config plugins:
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.14.5" /
"@babel/plugin-proposal-optional-chaining": "^7.14.5"
Answered By - Onesoftwareengineer
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.