You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Any pointers would be much appreciated. Keen to use edge functions if possible, or at least to understand the path down the line
[commonjs--resolver] Cannot bundle Node.js built-in "module" imported from "node_modules/astro-i18next/dist/index.js". Consider disabling ssr.noExternal or remove the built-in dependency.
error Cannot bundle Node.js built-in "module" imported from "node_modules/astro-i18next/dist/index.js". Consider disabling ssr.noExternal or remove the built-in dependency.
Error: Cannot bundle Node.js built-in "module" imported from "node_modules/astro-i18next/dist/index.js". Consider disabling ssr.noExternal or remove the built-in dependency.
at error (file:///home/ninjaa/bp/agreeable-ascension/node_modules/rollup/dist/es/shared/rollup.js:1858:30)
at throwPluginError (file:///home/ninjaa/bp/agreeable-ascension/node_modules/rollup/dist/es/shared/rollup.js:21587:12)
at Object.error (file:///home/ninjaa/bp/agreeable-ascension/node_modules/rollup/dist/es/shared/rollup.js:22541:20)
at Object.resolveId (file:///home/ninjaa/bp/agreeable-ascension/node_modules/vite/dist/node/chunks/dep-67e7f8ab.js:33611:34)
at Object.handler (file:///home/ninjaa/bp/agreeable-ascension/node_modules/vite/dist/node/chunks/dep-67e7f8ab.js:45606:19)
at file:///home/ninjaa/bp/agreeable-ascension/node_modules/rollup/dist/es/shared/rollup.js:22748:40
This is because edge functions don't have access to any node APIs, this is the same for Vercel Edge, Deno and Cloudflare workers (they are adding support for some packages here).
I was going to ask @yassinedoghri what does he think about creating a PR to handle this. I have been testing a solution, and I think a good way of handling this would be to re-introduce the resources option in configs. If this is set, then the i18next-fs-backend package — which is the one importing and using all the node APIs — won't be imported.
The only thing is that you would need to manually import all the translation files (if you are using namespaces). Is there any workaround for this last thing? Maybe a pre-build script that builds the resources object from all the translations files on the locales directory.
I think if this is solved, it can solve all the current issues with different environments (vercel edge, netlify edge, Deno and cloudflare workers).
PS: I recommend you to downgrade to 1.0.0-beta.12 and import everything you want in resources without using i18next-fs-backend.
Any pointers would be much appreciated. Keen to use edge functions if possible, or at least to understand the path down the line
Found a relatable issue for astrojs/image
withastro/astro#5307
The text was updated successfully, but these errors were encountered: