question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

After the release of `v1.0.0-rc.11`, `Module parse failed: Unexpected token` occurs

See original GitHub issue

As the title says, since v1.0.0-rc.11 the below error occurs:

START:
ℹ 「wdm」: Compiled successfully.
ℹ 「wdm」: Compiling...
✖ 「wdm」: 
ERROR in ./node_modules/htmlparser2/lib/esm/index.js 59:9
Module parse failed: Unexpected token (59: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
|     return getFeed(parseDOM(feed, options));
| }
> export * as DomUtils from "domutils";
| // Old name for DomHandler
| export { DomHandler as DefaultHandler };
 @ ./node_modules/cheerio/lib/esm/index.js 11:0-68
 @ ./node_modules/enzyme/build/ReactWrapper.js
 @ ./node_modules/enzyme/build/index.js
 @ ./test.entry.js

I think it’s a bug of cheerio, because it has been occurring since 3 days ago when the v1.0.0-rc.11 released.

Could you please look into this bug?

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:18
  • Comments:26 (4 by maintainers)

github_iconTop GitHub Comments

13reactions
mike-lischkecommented, Jun 13, 2022

People might not be able to upgrade a library, if that’s actually brought in by other modules (e.g. via create-react-app). Changes that require upgrades of other libraries should always be accompanied by at least a minor version increase.

Locking package import to cheerio@1.0.0-rc.10 fixed the issue for me. But that should really not be needed! Please do such changes in another release that raise at least the minor version number, so they are not automatically picked up.

11reactions
ygnohcommented, May 24, 2022

I resolved this problem by declaring cheerio in devDependencies like:

  "devDependencies": {
    "cheerio": "=1.0.0-rc.3",
    ...

Hope this helps.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Webpack React error: Module parse failed: Unexpected token
But when I try to create a dist file there is an error. How to fix that? enter image description here. From package.json...
Read more >
htmlparser2 unexpected token - You.com | The AI Search ...
Module parse failed: Unexpected token - Stack Overflow ... 1 Answer. Apparently it happened because you have two module properties in the webpack...
Read more >
[Help] Module parse failed: Unexpected token . Babel not ...
My babel.config.js stays the same with 6433 and not using .babelrc. I found .flowconfig was removed from master branch. Is it relevant ?...
Read more >
Build error with @arcgis/core and Angular 11: "Module parse ...
Just chiming in, am getting similar "unexpected token" errors after bumping to v4.24. Had been pinned at v4.22 due to changes to the...
Read more >
App.vue “Module parse failed: Unexpected token (1:0)” - MSDN
User1993186009 posted. Summary of the problem I am having: Hi,. I am facing the following issue while running ASPNET.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found