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

v3.1.1 version is raising Module parse failed: Unexpected token in index.mjs #29

Closed
mdissel opened this issue Jun 7, 2023 · 5 comments · Fixed by #31
Closed

v3.1.1 version is raising Module parse failed: Unexpected token in index.mjs #29

mdissel opened this issue Jun 7, 2023 · 5 comments · Fixed by #31

Comments

@mdissel
Copy link

mdissel commented Jun 7, 2023

I've added this component via npm and when i compile my code I get this exception when using v3.1.1 of this component. It does work correctly with version 2.2.0

ERROR in ./node_modules/stale-while-revalidate-cache/dist/index.mjs 516:41
Module parse failed: Unexpected token (516:41)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See Concepts | webpack

Node v16
Typescript 4.5

@jperasmus
Copy link
Owner

Hi, thanks for reporting the issue. I can see the error is thrown because of the Nullish coalescing operator (??) characters in the dist file. According to Node.green, it has been supported since at least Node.js v14.5.0

Can you double-check the Node.js version that you're using when the build is running?

@mdissel
Copy link
Author

mdissel commented Jun 8, 2023

I'm using Node v16.14.0..

Please check PaulLeCam/react-leaflet#883 for a similar issue (i'm using webpack 4.46.0)

@jperasmus
Copy link
Owner

Thanks for the link. I'll take a look at releasing a version without nullish coalescing.

@jperasmus
Copy link
Owner

Hey Marco, v3.1.2 should now not contain any nullish coalescing operators.

@mdissel
Copy link
Author

mdissel commented Jun 12, 2023

Thanks!

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