Alexandre-Fernandez / astro-i18n

A TypeScript-first internationalization library for Astro.
https://www.npmjs.com/package/astro-i18n
MIT License
249 stars 10 forks source link

This library breaks deployment with cloudflare #85

Open irg1008 opened 7 months ago

irg1008 commented 7 months ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. pnpm install
  2. build project
  3. See errors related to node APIs
  4. You may remove all astro-i18n from the project
  5. The project now builds correctly as it should

Expected behavior We should be able to build astro project with cloudflare adapter

Mandatory reproduction repository https://github.com/irg1008/ivanruiz

irg1008 commented 7 months ago

I think would be "easy" to fix updating dependencies to use "node:*"

irg1008 commented 7 months ago
[vite-plugin-pwa:build] [plugin vite:resolve] Cannot bundle Node.js built-in "fs" imported from "node_modules\.pnpm\esbuild@0.20.2\node_modules\esbuild\lib\main.js". Consider disabling ssr.noExternal or remove the built-in dependency.
file: C:/Users/Ivan/Documents/Projects/Web/ivanruiz/node_modules/.pnpm/esbuild@0.20.2/node_modules/esbuild/lib/main.js
  Stack trace:
    at getRollupError (file:///C:/Users/Ivan/Documents/Projects/Web/ivanruiz/node_modules/.pnpm/rollup@4.13.0/node_modules/rollup/dist/es/shared/parseAst.js:376:41)
    at Object.error (file:///C:/Users/Ivan/Documents/Projects/Web/ivanruiz/node_modules/.pnpm/rollup@4.13.0/node_modules/rollup/dist/es/shared/node-entry.js:19378:20)
    at Object.handler (file:///C:/Users/Ivan/Documents/Projects/Web/ivanruiz/node_modules/.pnpm/vite@5.2.2_@types+node@20.11.30_lightningcss@1.24.1/node_modules/vite/dist/node/chunks/dep-B-u6xNiR.js:67458:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async resolveId (file:///C:/Users/Ivan/Documents/Projects/Web/ivanruiz/node_modules/.pnpm/rollup@4.13.0/node_modules/rollup/dist/es/shared/node-entry.js:18144:26)
 ELIFECYCLE  Command failed with exit code 1.

I have confirmed removing this library removes the error

irg1008 commented 7 months ago

Breaks deplyment with deno deploy as well. Does this work with any SSR adapter at all?