cheerio icon indicating copy to clipboard operation
cheerio copied to clipboard

cheerio upgrade problem

Open wghule opened this issue 1 year ago • 9 comments

cheerio 1.0.0 is not supported for below node 18. for this case, can you upgrade cheerio the major version,such as 2.0.0?It causes automatic upgrade issues for existing projects.

wghule avatar Aug 14 '24 07:08 wghule

yes same problem, pls fix it asap.

LiangZuoting avatar Aug 14 '24 07:08 LiangZuoting

I have the same problem. Is there any workaround for this?

  • I tried to manually install a specific older version without the node 18 restriction but it didn't work.

YozoraNoTenshi avatar Aug 14 '24 08:08 YozoraNoTenshi

I tried with fixed version "cheerio":"1.0.0-rc.12" worked for me

linojjoy avatar Aug 14 '24 17:08 linojjoy

Releasing breaking changes from an RC means that one of our dependencies that was using rc12 now automatically installs 1.0.0, breaking the app for everyone not using Node 18. This was unexpected from an RC where the API should be stable and no breaking changes should be introduced.

cossssmin avatar Aug 15 '24 07:08 cossssmin

I am also running into this issue through an enzyme dependency. cheerio-1.0.0-rc.12 works but cheerio-1.0.0 fails. It looks like it's because parse5-parser-stream is not compatible with older node versions.

Daviddube avatar Aug 15 '24 18:08 Daviddube

ci/cd auto upgrade to 1.0.0, then bring this problem, I use node 16 and typescript 4.9.5, downgrade to cheerio":"1.0.0-rc.12, then fixed node_modules/cheerio/dist/commonjs/index.d.ts:7:1 - error TS1383: Only named exports may use 'export type'. 7 export type * from './types.js';

jxustchenyong avatar Aug 16 '24 02:08 jxustchenyong

This also bricked @iconify

|- file:///./node_modules/@iconify/tools/lib/svg/index.mjs:1
import cheerio from 'cheerio';
       ^^^^^^^
SyntaxError: The requested module 'cheerio' does not provide an export named 'default'

ichbinstudent avatar Aug 16 '24 04:08 ichbinstudent

This is also breaking bundling of react native projects: https://github.com/cheeriojs/cheerio/issues/4032

UNIDY2002 avatar Aug 16 '24 05:08 UNIDY2002

Same error here, using vite build custom script in pnpm:

/node_modules/.pnpm/[email protected]/node_modules/i18next-parser/dist/lexers/html-lexer.js:2 import cheerio from 'cheerio';var ^^^^^^^ SyntaxError: The requested module 'cheerio' does not provide an export named 'default'

JosueRodriguezExio avatar Aug 19 '24 11:08 JosueRodriguezExio

I tried with fixed version "cheerio":"1.0.0-rc.12" worked for me

worked for me

tungxuan1656 avatar Mar 05 '25 09:03 tungxuan1656

Closing as this won't be relevant anymore. Sorry for the additional work!

fb55 avatar Jun 08 '25 19:06 fb55

pls fix problem Render : SyntaxError: The requested module 'cheerio' does not provide an export named 'default' at ModuleJob._instantiate (node:internal/modules/esm/module_job:175:21) at async ModuleJob.run (node:internal/modules/esm/module_job:258:5) at async ModuleLoader.import (node:internal/modules/esm/loader:540:24) at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5)

mouha31 avatar Sep 22 '25 21:09 mouha31