Module parse failed: Unexpected token
after upgrading an NPM dependency
#16609
Replies: 1 comment 3 replies
-
You will have to apply babel-loader to the Please replace {
exclude: {
and: [/node_modules/], // Exclude libraries in node_modules ...
not: [
// Except for a few of them that needs to be transpiled because they use modern syntax
/swagger-ui/,
]
},
} If possible, please consider upgrade to webpack 5, as you are shipping transpiled code simply because webpack 4 does not recognize them, even if modern browsers support them natively. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, our project is made with webpack 4 babel 7 and we use
[email protected]
from node_modules.We recently installed
[email protected]
and something very weird happened when compiling:Usage:
Webpack loader:
Babel config:
Any ideas why is this failing? How to debug? What to try? We have to stick with webpack 4, which might be an issue...
Beta Was this translation helpful? Give feedback.
All reactions