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

✘ [ERROR] No loader is configured for ".node" files #74

Closed
pboling opened this issue May 16, 2024 · 6 comments
Closed

✘ [ERROR] No loader is configured for ".node" files #74

pboling opened this issue May 16, 2024 · 6 comments

Comments

@pboling
Copy link

pboling commented May 16, 2024

Just got an error error with Svelte 5.0.0-next.133, tried upgrading to Svelte 5.0.0-next.135, also SvelteKit 2.5.8. I've upgraded a lot of packages in the last day and dependabot has been fully broken on pnpm v9 ever since it was released months ago, so I wasn't able to upgrade packages "properly" by running CI for each.

My errors were:

✘ [ERROR] No loader is configured for ".node" files: node_modules/.pnpm/@node-rs+bcrypt-darwin-arm64@1.9.0/node_modules/@node-rs/bcrypt-darwin-arm64/bcrypt.darwin-arm64.node
    node_modules/.pnpm/@node-rs+bcrypt@1.9.0/node_modules/@node-rs/bcrypt/binding.js:165:36:
      165 │             nativeBinding = require('@node-rs/bcrypt-darwin-arm64')

and

✘ [ERROR] No loader is configured for ".node" files: node_modules/.pnpm/@node-rs+argon2-darwin-arm64@1.7.0/node_modules/@node-rs/argon2-darwin-arm64/argon2.darwin-arm64.node
    node_modules/.pnpm/@node-rs+argon2@1.7.0/node_modules/@node-rs/argon2/index.js:173:36:
      173 │             nativeBinding = require('@node-rs/argon2-darwin-arm64')

Being that neither is a direct dependency of the project, I looked to oslo which pulls them in. I had just upgraded to oslo v1.2.0.

Adding this to my vite.config.ts fixed it!

	optimizeDeps: {
		exclude: ['@node-rs/argon2', '@node-rs/bcrypt']
	},

Not sure if this is an indication of a bug, or if optimiseDeps excluding oslo is just how we configure oslo now...

@pboling
Copy link
Author

pboling commented May 16, 2024

Apparently a better alternative to excluding oslo is to exclude the actual offending dependencies.

        exclude: ['@node-rs/argon2', '@node-rs/bcrypt']

@pboling
Copy link
Author

pboling commented May 16, 2024

This appears to have been caused by the latest release of esbuild from 17 hours ago.

ref (Oslo Discord): https://discord.com/channels/1004048134218981416/1239596097752793221/1240675071203344505

@pboling
Copy link
Author

pboling commented May 16, 2024

Another related issue: vitejs/vite#12989

@DarthGigi
Copy link

+1 having the same issue

@pilcrowonpaper
Copy link
Owner

Unfortunately there's little Oslo can do here so the fix is to just exclude @node-rs/ packages

@creadevv
Copy link

creadevv commented Oct 3, 2024

Apparently this still does not work, or am I doing something wrong? I use SST ION (V3). Just setup the basics following the docs. Added to my existing sveltekit app.

My vite.config.ts:

import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vitest/config';

export default defineConfig({
	plugins: [sveltekit()],
	optimizeDeps: {
		exclude: ['@node-rs/argon2', '@node-rs/bcrypt']
	},
	test: {
		include: ['src/**/*.{test,spec}.{js,ts}']
	}
});

I tried adding this part also to the svelte.config.js file:

optimizeDeps: {
	exclude: ['@node-rs/argon2', '@node-rs/bcrypt']
},

Versions:

svelte-kit-sst:
    specifier: ^2.43.5
    version: 2.43.5
'@sveltejs/kit':
    specifier: ^2.6.1
    version: 2.6.1(@sveltejs/vite-plugin-svelte@3.1.2)(svelte@4.2.19)(vite@5.4.8)
/oslo@1.2.1:
    resolution: {integrity: *****}
    dependencies:
      '@node-rs/argon2': 1.7.0
      '@node-rs/bcrypt': 1.9.0
    dev: false

The problem is, Oslo requires these packages. I need Lucia Auth, who is including the Oslo package to be functional..

Already threw a lot of hours at it, with all the included frustration. How can I fix this? I realy dont want to go to AWS Amplify or Vercel. Vercel works btw, that is the frustrating part.

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

4 participants