-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
After the release of v1.0.0-rc.11
, Module parse failed: Unexpected token
occurs
#2545
Comments
Module parse failed: Unexpected token
occursv1.0.0-rc.11
, Module parse failed: Unexpected token
occurs
I have the same issue. |
The bundler is choking on For umijs/umi#8109: umijs seems to have switch to rollup afaict (at least I haven't been able to find a Webpack version), so there is a chance that updating some internal packages might do the trick? Please let me know if this makes sense! |
same issue |
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 [email protected] 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. |
@mike-lischke Do you know a way to lock the package version on In my project, |
I resolved this problem by declaring
Hope this helps. |
I've tried the suggestion by @ygnoh, and it works fine in my local build.. but fails in the GitLab pipeline.. |
lock the version in dependencies, like this doocs/md@551b07d |
it seems |
lock the cheerio version in your base package.json in dependencies or in devDependencies.. set it to "cheerio": "1.0.0-rc.10" |
works fine when it is referenced in dependencies.. I had added in the devDependencies earlier.. |
* test: failing client tests * Limit NodeJS to version 14.19.1 * fix: Slow npm install * use latest NodeJS v14 * run `npm list` * ignore `npm list` return code * lock cheerio version cheeriojs/cheerio#2545
As a side note, |
Yes, they do.. but since it was working fine for me till Friday with rc.10.. decided to go with it.. |
Seriously a life saver, thank you. |
+1 on the issue. Caused silent issues during builds. Was discovered only after an exhausting search as a dependency of a sub package, and most frustrating is that it was auto upgraded as rc11 treated as 'patch' (any default |
1.0.0-rc.11 is an issue for me because of the ECMAScript Modules used in parse5-htmlparser2-tree-adapter 7.0.0 ... The breaking change on parse5-htmlparser2-tree-adapter v7 is well documented : This is a shame, that this package (cheerio) bump its dependencies (with major change) without a major change on its version .... It cost me hours of debugging -_- How i landed here ? Spend hours to find this => Cheerio go to 1.0.0-rc.11 with parse5 v7 ==> all lib which use "cheerio": "^1.0.0-rc.10" will potentially blow up ... So, please next time read the changelog before up the dep... Meanwhile, here my fix : if you use yarn, add these lines in package.json :
if you use npm, add these lines in package.json :
Ressources |
|
@fb55 the solution seems to be adding to "exports" the deep import enzyme is using. |
We getting the below issue while creating the build
We tried updating both devDependencies and dependencies with "cheerio": "1.0.0-rc.3" But still we are getting same issue Any suggestions? |
For everyone that is encountering this, have a look at @lukescott's great writeup on this issue. Relevant here:
I understand that it is annoying to have to work around this issue. Unfortunately, I don't see an easy way to work around this issue without negative side effects for users with modern tooling, meaning that this won't be fixed. Hope that makes sense! |
@fb55 i don't understand - all you have to do is add an entry to "exports", which won't have a negative impact on literally anybody. Also, not everyone uses bundlers - enzyme runs in node, for example. |
Thanks for clarifying. fwiw, recommending webpack 5 isn't a great idea, because it's broken - it doesn't polyfill node builtins by default. |
* test: failing client tests * Limit NodeJS to version 14.19.1 * fix: Slow npm install * use latest NodeJS v14 * run `npm list` * ignore `npm list` return code * lock cheerio version cheeriojs/cheerio#2545
yes the equal to sign "=" in the statement helped me solve my issue too thankyou |
god |
Just my 2 cents here basing on this comment. I'm not a
|
Can confirm this also worked for me (for me |
I want to emphasize that this is not a
Revert all those dependencies to previous versions where they use |
To add to @ItzLarz: Modern versions of Webpack do understand the relevant syntax, so an upgrade will resolve this issue as well. See fb55/htmlparser2#1237 (comment) for more solutions. |
We need to add the cozy-notifications webpack configuration. We also need to fix cheerio version to avoid "export * as DomUtils from "domutils";" error cheeriojs/cheerio#2545 (comment)
We need to add the cozy-notifications webpack configuration. We also need to fix cheerio version to avoid "export * as DomUtils from "domutils";" error cheeriojs/cheerio#2545 (comment)
We need to add the cozy-notifications webpack configuration. We also need to fix cheerio version to avoid "export * as DomUtils from "domutils";" error cheeriojs/cheerio#2545 (comment)
We need to add the cozy-notifications webpack configuration. We also need to fix cheerio version to avoid "export * as DomUtils from "domutils";" error cheeriojs/cheerio#2545 (comment)
As the title says, since
v1.0.0-rc.11
the below error occurs:I think it's a bug of
cheerio
, because it has been occurring since 3 days ago when thev1.0.0-rc.11
released.Could you please look into this bug?
The text was updated successfully, but these errors were encountered: