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

No loader is configured for ".node" bcrypt.darwin-arm64.node #721

Open
AndriP8 opened this issue Oct 11, 2023 · 3 comments
Open

No loader is configured for ".node" bcrypt.darwin-arm64.node #721

AndriP8 opened this issue Oct 11, 2023 · 3 comments

Comments

@AndriP8
Copy link

AndriP8 commented Oct 11, 2023

I got an error like this
Screenshot 2023-10-11 at 22 22 56

i am using:

  • nodejs v16.19.1
  • nx for monorepo
  • @node-rs/bcrypt v1.7.3
  • chip M1
@hpohlmeyer
Copy link

I ran into the same issue with @node-rs/argon2. I could fix it by marking the package as external in my bundler.

Vite

// vite.config.ts

export default defineConfig({
  optimizeDeps: {
    exclude: ["@node-rs/argon2"],
  },
});

esbuild

import * as esbuild from 'esbuild'

await esbuild.build({
  external: ["@node-rs/argon2"]
  // other options …
})

@CdTgr
Copy link

CdTgr commented Dec 7, 2023

I too faced the same issue on package @node-rs/crc32-darwin-arm64 but didn't see any fixes.

@hpohlmeyer marking it as external will exclude the particular module from the build file, which when you try to run externally without any node_modules ( copy for example dist folder to somewhere and run it), throws an error as the module is not found.

Error: Cannot find module '@node-rs/crc32-darwin-arm64'

@hpohlmeyer
Copy link

Yes, but if you deploy your production dependencies along-side your bundle this works fine. If you want a single bundled file, you are right, this approach definitely does not work.

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

3 participants