Bug [ERROR] Could not resolve "crypto" #336
Replies: 2 comments 2 replies
-
After some research I added: serverNodeBuiltinsPolyfill: { to remix.config.js This brings a new error: ReferenceError: Buffer is not defined Is it possible to use another package then nanoid? |
Beta Was this translation helpful? Give feedback.
-
Hi! Could you make a repo with a reproduction of this issue? I haven't run into it myself so it will be hard to verify a fix. |
Beta Was this translation helpful? Give feedback.
-
I'm working on remix 2.1.0 when using validate-form 5.1.5 it throws an error about crypto:
[ERROR] Could not resolve "crypto"
The package "crypto" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
"dependencies": {
"@remix-run/css-bundle": "2.1.0",
"@remix-run/react": "2.1.0",
"@remix-validated-form/with-zod": "^2.0.7",
"date-fns": "^2.30.0",
"date-fns-tz": "^2.0.0",
"graphql": "^16.6.0",
"graphql-tag": "^2.12.6",
"isbot": "^3.6.6",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"remix-validated-form": "^5.1.5",
"zod": "^3.21.4"
},
├─┬ [email protected]
│ └── [email protected]
└─┬ [email protected]
└── [email protected]
Beta Was this translation helpful? Give feedback.
All reactions