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

Fail in building due to 'Cannot bundle Node.js built-in "node:path"' #1259

Open
VictorMartinezKwua opened this issue Aug 3, 2024 · 1 comment

Comments

@VictorMartinezKwua
Copy link

VictorMartinezKwua commented Aug 3, 2024

Builds are failing due to:
[commonjs--resolver] [plugin vite:resolve] Cannot bundle Node.js built-in "node:path" imported from "node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/node_modules/@keystatic/core/dist/keystatic-core-reader.worker.js". Consider disabling ssr.noExternal or remove the built-in dependency.

Also I see that:
WARN  deprecated [email protected]: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-inject.
 WARN  deprecated [email protected]: Please use @jridgewell/sourcemap-codec instead

 I don't know if this can be a problem but this packages seems to be called by @keystatic/core

 This starts happen when I updated the @astro/cloudflare dependenci to 11.0.3 and astro to 4.13.1

My astro.config:

export default defineConfig({
  integrations: [react(), markdoc(), keystatic(), tailwind(), mdx()],
  output: 'hybrid',
  adapter: cloudflare(),
  vite: {
    ssr: {
      noExternal: ['@keystatic/core']
    },
  }
});

I tried to modify vite build behavior as you can see, recommendated by the log I show at start of the issue:
"Consider disabling ssr.noExternal or remove the built-in dependency."

@amirzezo201
Copy link

Iam also facing the same issue

external: ["buffer", "path", "fs", "os", "crypto", "async_hooks"].map(
(i) => node:${i}
),

  i added this now the path error is gone but now i see node/fs promise error

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

2 participants