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

Unexpected token #33

Closed
RyuGuo opened this issue Jul 8, 2020 · 5 comments
Closed

Unexpected token #33

RyuGuo opened this issue Jul 8, 2020 · 5 comments

Comments

@RyuGuo
Copy link

RyuGuo commented Jul 8, 2020

node scripts/build.js

Creating an optimized production build...
Failed to compile.

./node_modules/_p-limit@3.0.1@p-limit/index.js
Module parse failed: Unexpected token (30:10)
You may need an appropriate loader to handle this file type.
| try {
| await result;
| } catch {}
|
| next();

my node vesion is v12.16.1

@RyuGuo
Copy link
Author

RyuGuo commented Jul 8, 2020

If I change to catch(e), it will throw this error:

node scripts/build.js

Creating an optimized production build...
Failed to compile.

Failed to minify the code from this file:

    ./node_modules/_p-limit@3.0.1@p-limit/index.js:4

@sindresorhus
Copy link
Owner

This is a problem with the bundler you use, not this package. Open an issue over there instead.

@andreidobrinski
Copy link

Hey @RyuGuo, did you find a fix for this?

@RyuGuo
Copy link
Author

RyuGuo commented Jul 31, 2020

Yes.There is something wrong with the bundler I use.
When I copy your code to my project directory, there will be no problem with the bundler.Thanks a lot.

@utenma
Copy link

utenma commented Apr 25, 2022

this is valid ES10 syntax, you need to transpile to es6 with babel, because the author has no intention to provide a ES6 code on npm, however you will need to add a blunder rule to transpile node_modules libraries

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

No branches or pull requests

4 participants