keystatic icon indicating copy to clipboard operation
keystatic copied to clipboard

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

Open VictorMartinezKwua opened this issue 6 months ago • 1 comments

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."

VictorMartinezKwua avatar Aug 03 '24 10:08 VictorMartinezKwua