Unexpected token
RyuGuo opened this issue · 5 comments
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
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
This is a problem with the bundler you use, not this package. Open an issue over there instead.
Hey @RyuGuo, did you find a fix for this?
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.
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