Module parse failed: Unexpected token (48:9)
evanzielbooking opened this issue · 2 comments
evanzielbooking commented
Line 93 in 318a812
I upgraded the sanitize-html package from ^1 to ^2, after which htmlparser2 got updated from 4.1.0 to 8.0.0.
Now I'm running into the following build error:
ERROR in ./node_modules/htmlparser2/lib/esm/index.js 48:9
Module parse failed: Unexpected token (48:9)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| * They should probably be removed eventually.
| */
> export * as ElementType from "domelementtype";
| import { getFeed } from "domutils";
| export { getFeed } from "domutils";
@ ./node_modules/sanitize-html/index.js 1:19-41
Node Version: 18.14.0
NPM version: 9.3.1
When I try to search for this error online, I see different similar kind of issues that are mostly resolved by downgrading the package or changing Node versions...
Any suggestions? Thanks
fb55 commented
The export *
syntax is not supported by your webpack version. Bumping webpack to version 5 will fix this error.
Insomniak313 commented
Why webpack "^5" is not a dev dependency ? I guess it would solve this error