pilcrowOnPaper / oslo

A collection of auth-related utilities
https://oslo.js.org
MIT License
852 stars 28 forks source link

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

Closed pboling closed 1 week ago

pboling commented 2 weeks ago

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 commented 2 weeks ago

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

        exclude: ['@node-rs/argon2', '@node-rs/bcrypt']
pboling commented 2 weeks ago

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 commented 2 weeks ago

Another related issue: https://github.com/vitejs/vite/discussions/12989

DarthGigi commented 2 weeks ago

+1 having the same issue

pilcrowOnPaper commented 1 week ago

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