App reviews, troubleshooting, and recommendations
I've successfully integrated the Remix-validated form library into my Remix v2 application. However, when attempting to implement the same library in the Shopify Hydrogen framework, I encountered an error stating, '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.'
It's worth noting that this implementation works seamlessly on Hydrogen v1, but issues arise in v2. I'm seeking assistance to address this discrepancy and resolve the 'crypto' package error in the context of Shopify Hydrogen v2. Any guidance or insights would be greatly appreciated.
Solved! Go to the solution
This is an accepted solution.
Hello @kiran121 ,
The problem is that Oxygen is using Cloudflare Worker under the hood, and it is not a Node.js environment; it already has a built-in "crypto" module, and the remix-validated-form importing this package will cause the error.
In this case, you can try setting "serverNodeBuiltinsPolyfill" in the remix config like follows:
serverNodeBuiltinsPolyfill: {
modules: {
crypto: true, // Provide a JSPM polyfill
},
},
Reference: https://remix.run/docs/en/main/file-conventions/remix-config#servernodebuiltinspolyfill
This is an accepted solution.
Hello @kiran121 ,
The problem is that Oxygen is using Cloudflare Worker under the hood, and it is not a Node.js environment; it already has a built-in "crypto" module, and the remix-validated-form importing this package will cause the error.
In this case, you can try setting "serverNodeBuiltinsPolyfill" in the remix config like follows:
serverNodeBuiltinsPolyfill: {
modules: {
crypto: true, // Provide a JSPM polyfill
},
},
Reference: https://remix.run/docs/en/main/file-conventions/remix-config#servernodebuiltinspolyfill
Thank you so much, now it's working perfectly.
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025