No matching export in node-modules-polyfillscrypto for import createHash with latest version
See original GitHub issueHello. I have updated my Remix app (indies-stack) dependencies and came across this error message :
No matching export in node-modules-polyfillscrypto for import createHash
upon building the application or starting the development environment. Going back to version 0.7.0 of mailing and mailing-core didn’t trigger the error.
I do not use crypto in my code.
(This is my first issue, forgive me if I do not provide enough details)
Issue Analytics
- State:
- Created a year ago
- Comments:13
Top Results From Across the Web
ERROR: No matching export in "node-modules ... - GitHub
Bug description This issue comes about when trying to run remix through Cloudflare pages.
Read more >ERROR: No matching export in "node-modules-polyfills:crypto ...
I'm finding no clue on what to do about this issue when trying to run remix through Cloudflare pages. node_modules/@algolia/client-search/dist/ ...
Read more >Nodejs crypto in typescript file - javascript - Stack Overflow
I have created my own hash.js file that requires crypto and exports two functions that use crypto. It works ...
Read more >Crypto | Node.js v19.3.0 Documentation
The crypto.createHash() method is used to create Hash instances. Hash objects are not to be created directly using the new keyword.
Read more >Node.js crypto.createHash() Method - GeeksforGeeks
algorithm: It is dependent on the accessible algorithms which are favored by the version of OpenSSL on the platform. It returns string.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @psugihara, I have tried to recreate the issue, without success. I am using React@18.2.0 btw. I have seen a notice on the terminal specifying the peer-deps of mjml-react, and react-reconciler needed 17.0.0.
I am using mailing for my Vinylmania.fr project.
I found a solution, posting here to save someone some time in the future.
This is a Remix issue not Mailing’s.
The gist of it is that Remix has the concept of server vs client bundles. When in doubt it tries to make the code work for both, that’s why it’s trying to polyfill
node:crypto
for the borowser.One way to tell it that this email stuff is purely a server’s business, one should name the file
[name].server.ts
as per the docs: https://remix.run/docs/en/v1/pages/gotchas#server-code-in-client-bundles.In my case, I kept all of my code the same, exept that in the emails folder I have the structure:
the
"server"
insendEmails.server.ts
deals with the issue, and theindex.ts
file gives me nice imports.