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

Breaks after Astro updates to 5.0.3 #2658

Closed
1 task
Signum opened this issue Dec 7, 2024 · 17 comments
Closed
1 task

Breaks after Astro updates to 5.0.3 #2658

Signum opened this issue Dec 7, 2024 · 17 comments

Comments

@Signum
Copy link

Signum commented Dec 7, 2024

What version of starlight are you using?

0.29.2

What version of astro are you using?

5.0.3

What package manager are you using?

pnpm

What operating system are you using?

Linux

What browser are you using?

Firefox

Describe the Bug

Astro asked me to update to version 5. So I did:

pnpm dlx @astrojs/upgrade

 astro   Integration upgrade in progress.

      ◼  @astrojs/check is up to date on v0.9.4
      ◼  @astrojs/sitemap is up to date on v3.2.1
      ●  @astrojs/starlight will be updated to v0.29.2
      ▲  astro will be updated to  v5.0.3 

  wait   One package has breaking changes. Continue?
         Yes

 check   Be sure to follow the CHANGELOG.
         astro Upgrade to Astro v5

 ██████  Installing dependencies with pnpm...

╭─────╮  Houston:
│ ◠ ◡ ◠  Have fun building!
╰─────╯

…which I immediately regretted…

npx astro dev            
16:58:46 [vite] (ssr) Error when evaluating SSR module /home/chaas/projekte/ispmail-astro/workaround/astro.config.mjs:
|- Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './jsx/renderer.js' is not defined by "exports" in /home/chaas/projekte/ispmail-astro/workaround/node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected]_/node_modules/astro/package.json imported from /home/chaas/projekte/ispmail-astro/workaround/node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected]_/node_modules/@astrojs/mdx/dist/index.js
    at exportsNotFound (node:internal/modules/esm/resolve:314:10)
    at packageExportsResolve (node:internal/modules/esm/resolve:662:9)
    at packageResolve (node:internal/modules/esm/resolve:842:14)
    at moduleResolve (node:internal/modules/esm/resolve:926:18)
    at defaultResolve (node:internal/modules/esm/resolve:1056:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:654:12)
    at #cachedDefaultResolve (node:internal/modules/esm/loader:603:25)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:586:38)
    at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:242:38)
    at ModuleJob._link (node:internal/modules/esm/module_job:135:49)

[astro] Unable to load your Astro config

Package subpath './jsx/renderer.js' is not defined by "exports" in /home/chaas/projekte/ispmail-astro/workaround/node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected]_/node_modules/astro/package.json imported from /home/chaas/projekte/ispmail-astro/workaround/node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected]_/node_modules/@astrojs/mdx/dist/index.js
  Stack trace:
    at exportsNotFound (node:internal/modules/esm/resolve:314:10)
    at packageResolve (node:internal/modules/esm/resolve:842:14)
    at defaultResolve (node:internal/modules/esm/resolve:1056:11)
    at #cachedDefaultResolve (node:internal/modules/esm/loader:603:25)
    at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:242:38)

Link to Minimal Reproducible Example

https://github.com/Signum/starlight-astro5-breakage

Participation

  • I am willing to submit a pull request for this issue.
@logaretm
Copy link

logaretm commented Dec 7, 2024

Seeing this as well after upgrade to v5 👍

@userdocs
Copy link

userdocs commented Dec 8, 2024

Follow this pr: #2612

@morellodev
Copy link
Contributor

As a temporary fix, add this to your package.json:

"overrides": {
  "@astrojs/mdx": "^4.0.0"
}

@samrith-s
Copy link

@morellodev added the override, but still got the same issue

@morellodev
Copy link
Contributor

Did you re-run npm install again? Which package manager are you using?

@PandaLord
Copy link

PandaLord commented Dec 10, 2024

same here, got the same issue even added the override, and i am using pnpm for now

@morellodev
Copy link
Contributor

The work around is fine for me, if you use pnpm you need to edit the package.json as follows (reference here):

"pnpm": {
  "overrides": {
    "@astrojs/mdx": "^4.0.0"
  }
}

and then re-run pnpm install. This should fix the issue!

@PandaLord
Copy link

Thanks @morellodev , after removing the node_modules and use your configuration, works fine now. Thanks!

@samrith-s
Copy link

@morellodev I am using Yarn

@DavidJFelix
Copy link

"pnpm": {
  "overrides": {
    "@astrojs/mdx": "^4.0.0"
  }
}

@samrith-s I think you can use resolutions: https://yarnpkg.com/configuration/manifest#resolutions

@samrith-s
Copy link

samrith-s commented Dec 11, 2024

@samrith-s I think you can use resolutions: https://yarnpkg.com/configuration/manifest#resolutions

@DavidJFelix tried doing that, but still got the same error unfortunately

@Smart-Ace-Designs
Copy link

For bun, this worked for me:

"overrides": {
  "@astrojs/mdx": "^4.0.0"
}

And had to add this to astro.config.mjs:

legacy: {
    collections: true,
  },

Delete node_modules and then bun i

@HiDeoo
Copy link
Member

HiDeoo commented Dec 14, 2024

Support for Astro v5 has been released in Starlight v0.30.0. Thanks for your patience.

@HiDeoo HiDeoo closed this as completed Dec 14, 2024
@andersk
Copy link

andersk commented Dec 16, 2024

Something’s still broken. If you open the official StackBlitz template linked from getting started, it uses astro 5.0.8 and @astrojs/starlight 0.30.2, but it shows an error page and the following console output:

❯ npm install && npm run dev

added 417 packages in 11s

206 packages are looking for funding
  run `npm fund` for details

> @example/[email protected] dev
> astro dev

14:00:37 [types] Generated 4ms

 astro  v5.0.8 ready in 7137 ms

┃ Local    http://localhost:4321/
┃ Network  use --host to expose

The collection "docs" does not exist or is empty. Ensure a collection directory with this name exists.
14:00:41 [content] Syncing content
14:00:41 [content] Content config changed
14:00:41 [content] Astro version changed
14:00:41 [content] Clearing content store
14:00:41 [content] Synced content
14:00:41 watching for file changes...
14:00:46 [ERROR] [RenderUndefinedEntryError] 
  Hint:
    Check if the entry is undefined before passing it to `render()`
  Error reference:
    https://docs.astro.build/en/reference/errors/render-undefined-entry-error/
  Stack trace:
    at /home/projects/yqnimzjvjx.github/node_modules/astro/dist/core/errors/errors.js:13:5
    [...] See full stack trace in the browser, or rerun with --verbose.

@delucis
Copy link
Member

delucis commented Dec 16, 2024

Something’s still broken. If you open the official StackBlitz template linked from getting started, it uses astro 5.0.8 and @astrojs/starlight 0.30.2, but it shows an error page and the following console output:

Astro seems to be struggling with race conditions around content collections in v5. If you manually run astro sync before astro dev, things seems to work OK. Hoping we can find a solution soon.

tinoue-team pushed a commit to kinmapping/linuledge that referenced this issue Dec 16, 2024
- astro version 4 -> 5
- いくつかのビルドエラーが発生
	- withastro/starlight#2658
	- output の設定が変更される=> 削除:hybridレンダリングモード(https://docs.astro.build/en/guides/upgrade-to/v5/#removed-hybrid-rendering-mode)
	- [cannot find entry point module 'astro:db' について](withastro/astro#12699)
@samrith-s
Copy link

Starlight with @astrojs/starlight-tailwind still breaks with the same error.

13:31:44 [vite] (ssr) Error when evaluating SSR module ~/Projects/hali/docs/astro.config.ts:
|- Error: Cannot find module '~/Projects/hali/docs/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js'
    at createEsmNotFoundErr (node:internal/modules/cjs/loader:1181:15)
    at finalizeEsmResolution (node:internal/modules/cjs/loader:1169:15)
    at resolveExports (node:internal/modules/cjs/loader:591:14)
    at Module._findPath (node:internal/modules/cjs/loader:668:31)
    at Module._resolveFilename (node:internal/modules/cjs/loader:1130:27)
    at Module._load (node:internal/modules/cjs/loader:985:27)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at require (node:internal/modules/helpers:176:18)
    at Object.<anonymous> (~/Projects/hali/docs/node_modules/sucrase/dist/computeSourceMap.js:1:92)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)

[astro] Unable to load your Astro config

node:internal/process/promises:289
            triggerUncaughtException(err, true /* fromPromise */);
            ^

Error: Cannot find module '~/Work/Projects/hali/docs/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js'
    at createEsmNotFoundErr (node:internal/modules/cjs/loader:1181:15)
    at finalizeEsmResolution (node:internal/modules/cjs/loader:1169:15)
    at resolveExports (node:internal/modules/cjs/loader:591:14)
    at Module._findPath (node:internal/modules/cjs/loader:668:31)
    at Module._resolveFilename (node:internal/modules/cjs/loader:1130:27)
    at Module._load (node:internal/modules/cjs/loader:985:27)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at require (node:internal/modules/helpers:176:18)
    at Object.<anonymous> (~/Projects/hali/docs/node_modules/sucrase/dist/computeSourceMap.js:1:92)
    at Module._compile (node:internal/modules/cjs/loader:1376:14) {
  code: 'MODULE_NOT_FOUND',
  path: '~/Work/Projects/hali/docs/node_modules/@jridgewell/gen-mapping/package.json'
}

Node.js v20.11.1

@delucis
Copy link
Member

delucis commented Dec 17, 2024

Starlight with @astrojs/starlight-tailwind still breaks with the same error.

That appears to be a different error from any of the ones shared above. A new issue with a reproduction would be the best way to share this.

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

No branches or pull requests