Skip to content

[Astro5 + Starlight + Cloudflare] Cannot build with Starlight and Cloudflare adapter #2875

Open
@GoodLucky777

Description

@GoodLucky777

Astro Info

Astro                    v5.0.5
Node                     v18.20.3
System                   Linux (x64)
Package Manager          unknown
Output                   static
Adapter                  @astrojs/cloudflare
Integrations             @astrojs/starlight

Describe the Bug

If I try to build the Astro 5 website with Starlight and Cloudflare adapter, the build error will occurs.

Build error log:

$ npm run build

00:47:37 [build] Building static entrypoints...
00:47:38 [ERROR] [vite] x Build failed in 636ms
[commonjs--resolver] [plugin vite:resolve] Cannot bundle Node.js built-in "node:path" imported from "node_modules/@astrojs/starlight/utils/collection.ts". Consider disabling environments.ssr.noExternal or remove the built-in dependency.
  Stack trace:
    at getRollupError (file:///home/projects/astro5-starlight-cloudflare-build-error/node_modules/rollup/dist/es/shared/parseAst.js:558:41)
    at error (file:///home/projects/astro5-starlight-cloudflare-build-error/node_modules/rollup/dist/es/shared/node-entry.js:20652:33)
    at handler (file:///home/projects/astro5-starlight-cloudflare-build-error/node_modules/vite/dist/node/chunks/dep-yUJfKD1i.js:50867:15)
    at then/< (https://astro5starlightcloudflarebuild-el3s.w-corp-staticblitz.com/blitz.c8c182a3.js:40:23197)

What's the expected result?

No build errors.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/astro5-starlight-cloudflare-build-error

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    has-workaroundIssue that has a workaround but we’d still like to address🐛 bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions