Skip to content
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

Error in "./App.tsx": Module parse failed: Unexpected token #262

Closed
sleaper opened this issue Oct 7, 2022 · 6 comments
Closed

Error in "./App.tsx": Module parse failed: Unexpected token #262

sleaper opened this issue Oct 7, 2022 · 6 comments
Labels

Comments

@sleaper
Copy link

sleaper commented Oct 7, 2022

Question

I successfully set up my React native app v0.69 with Repack v3 and pnpm. I executed all the necessary steps that are here: https://re-pack.netlify.app/docs/getting-started. I can install the app with npx react-native webpack-bundle command. Also I have node v16.14.2 and I use this default webpack config template: https://github.com/callstack/repack/blob/main/templates/webpack.config.mjs

But when I start webpack with this command npx react-native webpack-start I get this error message:
image

If you need more information feel free to ask.

@jbinda
Copy link
Collaborator

jbinda commented Oct 26, 2022

hi @sleaper ! Thanks for posting your question.

I assume after initial setup that you've mentioned you still have Metro. Can you try to run the app using metro and see if that will work ?

If yes, you can also try use node 16.15.0.

@RafikiTiki
Copy link
Member

@sleaper please try updating node to at least 16.15.x. Here's the PR (nodejs/node#41736) which removes the need to pass --experimental-json-modules flag in order to handle json modules. It was merged in node 16.15.

@sleaper
Copy link
Author

sleaper commented Oct 31, 2022

hi @sleaper ! Thanks for posting your question.

I assume after initial setup that you've mentioned you still have Metro. Can you try to run the app using metro and see if that will work ?

If yes, you can also try use node 16.15.0.

Metro works perfectly well, I will try to update node.

@RafikiTiki
Copy link
Member

@sleaper any luck with node 16.15.0?

@sleaper
Copy link
Author

sleaper commented Dec 25, 2022

Could not make it work even with node v.16.15.0. For now I will have to use pnpm without symlinks.

@sleaper sleaper closed this as completed Dec 25, 2022
@RafikiTiki
Copy link
Member

If you can provide a minimal reproduction repository I might be able to help :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants