epicweb-dev / epic-stack

This is a Full Stack app starter with the foundational things setup and configured for you to hit the ground running on your next EPIC idea.
https://www.epicweb.dev/epic-stack
MIT License
4.33k stars 355 forks source link

Crypto from @epic-web/totp being included in the client build #484

Closed arpitdalal closed 11 months ago

arpitdalal commented 11 months ago

I was trying to add pwa support to the epic-stack but got an error saying that Crypto is a node package and after some digging, I found out that node crypto from @epic-web/totp is being included in the client build as well. To resolve this, I just exported everything from @epic-web/totp from a .server.ts file and imported everything from that .server.ts file instead of directly importing from @epic-web/totp

kentcdodds commented 11 months ago

Ah, yes, we'll wanna do that. Would you mind opening a pull request?

We do something similar for litefs-js: https://github.com/epicweb-dev/epic-stack/blob/main/app/utils/litefs.server.ts

Kinda annoying :(

arpitdalal commented 11 months ago

of course

arpitdalal commented 11 months ago

closed in #485