-
Hi, I am working on building a Remix application that uses MUI components (and by extension emotion), vite as the build tool and was planning on hosting it using Cloudflare Pages. I've not had any issues getting emotion to work with remix locally, running on full fat node, however when I try to deploy the app to cloudflare or use wrangler to run the app locally as if it were using cloudflares runtime I am getting a bunch of errors around packages using built in node packages that arn't supported and the offending packages dont append a "node:" to the start of the import/require so wrangler/cf cant make it compatible. These are packages that either emotion uses directly or indirectly and I have found a thread talking about this from 2021 here. There was a PR raised in 2022 related to it that has been merged here that seems to suggest that this should be sorted and it should just work out the box now? I have seen this which was mentioned in the thread but as I am using vite I can't get the same behaviour working. I can't work out how to get this to work however, I dont know if I'm being dumb or if I've missed something but I can't find any examples relating to this online and none of the examples that are online adress it. Is there anything special I need to do to get this working with cloudflares runtime? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Okay after having a sleep I have seen another issue that has solved the problem. issue is related to using the @emotion/server package that is reliant on the problem packages. Solution is to just make you own version without the offending method causing the issues. See here for a step by step |
Beta Was this translation helpful? Give feedback.
Okay after having a sleep I have seen another issue that has solved the problem. issue is related to using the @emotion/server package that is reliant on the problem packages.
Solution is to just make you own version without the offending method causing the issues. See here for a step by step