Skip to content

Why is my web build failing with "Unexpected token" errors? #2052

Answered by ShivamS136
ShivamS136 asked this question in Help
Discussion options

You must be logged in to vote

Thank you so much @necolas
Finally, It's been resolved, my Hello World is done. Now I am going to enhance my knowledge about react-native and react-native-web and will be using this at Indiamart.

These 2 replies helped me to get the issue.

Reply 1 by @necolas
This line in the stack trace is telling you that you're trying to bundle RN internal code in your web bundle: node_modules/react-native/Libraries/NewAppScreen/index.js.

First, you should not be loading any of the RN package on web, especially not parts that aren't part of the public API . Second, as mentioned in the inline comments of the config you pasted above, you need to explicitly list everything in node_modules that needs comp…

Replies: 4 comments 14 replies

Comment options

You must be logged in to vote
2 replies
@ShivamS136
Comment options

@necolas
Comment options

Comment options

You must be logged in to vote
7 replies
@ShivamS136
Comment options

@ShivamS136
Comment options

@necolas
Comment options

@necolas
Comment options

@ShivamS136
Comment options

Comment options

You must be logged in to vote
5 replies
@ShivamS136
Comment options

@dalcib
Comment options

@ajblog
Comment options

@ShivamS136
Comment options

@rdewolff
Comment options

Answer selected by ShivamS136
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
6 participants
Converted from issue

This discussion was converted from issue #2050 on June 09, 2021 15:40.