Skip to content
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

New Release Broken? #3986

Closed
mgtballison opened this issue Aug 9, 2024 · 5 comments
Closed

New Release Broken? #3986

mgtballison opened this issue Aug 9, 2024 · 5 comments

Comments

@mgtballison
Copy link

We're getting this error as of about 3 hours ago. Wondering if it is related to the latest release of cheerio.

> astro check && astro build
9:11:58 PM [vite] Error when evaluating SSR module /opt/atlassian/pipelines/agent/build/website/astro.config.mjs: failed to import "astro-icon"
|- file:///opt/atlassian/pipelines/agent/build/website/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'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:123:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:191:5)
    at async ModuleLoader.import (node:internal/modules/esm/loader:337:24)
    at async nodeImport (file:///opt/atlassian/pipelines/agent/build/website/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:52928:15)
    at async ssrImport (file:///opt/atlassian/pipelines/agent/build/website/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:52786:16)
    at async eval (/opt/atlassian/pipelines/agent/build/website/astro.config.mjs:7:31)
    at async instantiateModule (file:///opt/atlassian/pipelines/agent/build/website/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:52844:5)
[astro] Unable to load your Astro config
@NeKosmico
Copy link

We're getting this error as of about 3 hours ago. Wondering if it is related to the latest release of cheerio.

> astro check && astro build
9:11:58 PM [vite] Error when evaluating SSR module /opt/atlassian/pipelines/agent/build/website/astro.config.mjs: failed to import "astro-icon"
|- file:///opt/atlassian/pipelines/agent/build/website/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'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:123:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:191:5)
    at async ModuleLoader.import (node:internal/modules/esm/loader:337:24)
    at async nodeImport (file:///opt/atlassian/pipelines/agent/build/website/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:52928:15)
    at async ssrImport (file:///opt/atlassian/pipelines/agent/build/website/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:52786:16)
    at async eval (/opt/atlassian/pipelines/agent/build/website/astro.config.mjs:7:31)
    at async instantiateModule (file:///opt/atlassian/pipelines/agent/build/website/node_modules/vite/dist/node/chunks/dep-NjL7WTE1.js:52844:5)
[astro] Unable to load your Astro config

I still have that same error :'/

@rafipiccolo
Copy link

rafipiccolo commented Aug 10, 2024

it seems there's no default export anymore.

But the import style of the documentation works.

// before
import cheerio from 'cheerio';
// after
import * as cheerio from 'cheerio';

if that remains, it will require a fix on every dependent package.
or maybe cheerio would agree to re-add a default export

@NeKosmico
Copy link

it seems there's no default export anymore.

But the import style of the documentation works.

// before
import cheerio from 'cheerio';
// after
import * as cheerio from 'cheerio';

if that remains, it will require a fix on every dependent package. or maybe cheerio would agree to re-add a default export

Yes it works, but there are projects that use the old version, for now for me a solution was to use the old version exact

{
"dependencies": {
  "cheerio": "1.0.0-rc.12"
}
}

@fb55
Copy link
Member

fb55 commented Aug 10, 2024

The default import had been deprecated for several years now, and was removed with the new release: https://github.com/cheeriojs/cheerio/releases/tag/v1.0.0

There were a number of bugs caused by having the default export, which are finally a thing of the past. I appreciate that it is annoying having to update your imports, but you are getting a less error-prone experience in exchange.

@fb55 fb55 closed this as not planned Won't fix, can't repro, duplicate, stale Aug 10, 2024
@mgtballison
Copy link
Author

@fb55 Thanks for your reply! Appreciate the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants