Remix and Vite - 2 error(s) and 0 warning(s) when compiling Worker.
I am trying to use pages for the first time and having an issue when trying to deploy. Working locally, everything works as expected but when building and running I get the error:
2 error(s) and 0 warning(s) when compiling Worker.
This is for:
and:
I am using the template provided by Cloudflare, I have added the compatibility flag "nodejs_compat" and this is my dependencies:
I'm not sure how to fix this, as the guidance seems to be setting your compatibility flag, which I have done in wrangler.toml:
compatibility_flags = [ "nodejs_compat" ]
Any help would be appreciated!3 Replies
I won't be much help other than to say I was about to post the exact same problem today 😅 although I've got 19 errors of similar nature 👀
I had quite a few as well, then I added the wrangler.toml part but these two won't go away.
I've always tried to change the compatibility_date to see if that would make a different but it did not :/
I don't think I've done anything too out of the ordinary either. I've followed the remix-auth docs and added prisma and tailwind, so I'm quite confused by the issues I have.
I noticed not everything was up to date, so I've updated all my dependencies but still get the same error.
I ran npm ls crypto and npm ls stream and have no dependencies relying on this, so I'm not sure what the next steps are 😅
@Dan 👍 and anyone else who might get stuck... I got help on the Remix discord and my issue was I am importing from remix-node instead of cloudflare.
I was doing auth and had:
import { createCookieSessionStorage } from "@remix-run/node";
Instead of:
import { createCookieSessionStorage } from "@remix-run/cloudflare";
Have a look through your code and make sure you import from @remix-run/cloudflare
for anything node related.Interesting, thanks mate. I just had a quick look I suspect it was some mdx package for me.