-
Notifications
You must be signed in to change notification settings - Fork 53
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
No loader is configured for ".node" files? #198
Comments
Can you find this .node file in your node_modules directory? |
I created a sample repo here: https://codesandbox.io/p/github/alexo382/test-resvg Is it because the Remix compiler that uses esbuild doesn't support .node files? It's strange because I spoke with a Remix user in discord that had resvg-js working fine in their projects. Thanks again 🙏 |
Please see: #175 (comment) |
Perhaps you need to mark @resvg/resvg-js as external for esuild? I was getting this issue with Netlify (which uses esbuild) until I marked it as external in the Netlify config. |
Has anyone figured this out? |
This is your solution; works 10 / 10 🥳
|
I have the same issue in a NextJS project. Could there be a webpack configuration that works? I found the node-loader? I've also tried the proposed esbuild solution but couldn't get it to work. |
Here's a reference case used in netlify: creatures-sh/creatures.sh#2 |
@julianprester Hey Julian, I faced the same issue in a Next.js project (version 13.5.3) and I was able to solve it by adding the library (in my case @resvg/resvg-js) to /** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
serverComponentsExternalPackages: ["@resvg/resvg-js"],
},
... I hope this helps. Reference: https://nextjs.org/docs/app/api-reference/next-config-js/serverComponentsExternalPackages |
Same issue using bun & astrojs. |
If you're using Astro you can add this to your
|
Hi! I have the same issue with SvelteKit when I try to deploy on Vercel! I added the following lines in my vite.config.js, without success : build: {
rollupOptions: {
external: ['@resvg/resvg-js']
}
},
optimizeDeps: {
exclude: ['@resvg/resvg-js']
} Does anyone have an example or an idea on how to fix the problem? |
Note that I also tried with this config in svelte.config.js : const config = {
}; Without success :/ |
This is still an issue. With latest Webpack or Vite, attempting to use:
Is not working because underneath it imports .node files for each target platform for some reason. Excluding from Anyhow, for now I managed it to work on front-end with WASM using:
|
I'm trying to use resvg-js in a Remix project with a Node runtime but I don't seem to be able to get around this error:
Any tips to get past this would be greatly appreciated. I'm running macOS Ventura with an M1 CPU.
Thanks!
The text was updated successfully, but these errors were encountered: