Closed milindgoel15 closed 8 months ago
Import trace for requested module: ./node_modules/@mapbox/node-pre-gyp/lib/ sync ^\.\/.*$ ./node_modules/@mapbox/node-pre-gyp/lib/node-pre-gyp.js ./node_modules/bcrypt/bcrypt.js ./pages/test.tsx - wait compiling... - error ./node_modules/@mapbox/node-pre-gyp/lib/clean.js:8:0 Module not found: Can't resolve 'fs' https://nextjs.org/docs/messages/module-not-found
What did you expect to happen? No error is thrown
Which version of nodejs and OS? Nodejs: v20.9.0 Windows: 11 22h2
Steps to reproduce:
Sample nextjs page code:
hello world
bcrypt is a native module and does not work in the browser. Use bcryptjs instead
It will work on server components with "use server" but you will need to disable bundling it.
What did you expect to happen? No error is thrown
Which version of nodejs and OS? Nodejs: v20.9.0 Windows: 11 22h2
Steps to reproduce:
Sample nextjs page code:
code
```tsx import React from "react"; import bcrypt from "bcrypt"; let Test = () => { const salt = bcrypt.genSaltSync(10); return ( <>hello world
> ); }; export default Test; ```