New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support serverModuleFormat: "cjs" #135
Comments
Hi. The server module format shouldn't affect your site's module format. What happens if you try to deploy as-is, with your site in cjs and the server still as esm? |
Do you mean using cjs for your application but set the remix config serverModuleFormat to esm? You'd have to remove I made a demo project at https://github.com/Life-Swap/remix2test with a few branches that attempt to get things working but no luck so far. It's deployed at https://bucolic-blini-fa5899.netlify.app with branch deploys enabled |
If you remove |
That works. Thank you. I also had to set |
Great! The dev server shouldn't be using the Netlify config unless you're deploying to edge functions, because it should be using the Remix dev server instead. That's why there's the conditional env var in the sample config |
Is your feature request related to a problem? Please describe.
I'm trying to upgrade a project to remix version 2 that runs on netlify. It looks like it would be a huge effort to get it to run with
esm
module format and would therefor like to configure remix to useserverModuleFormat: "cjs"
.Everything seems to work fine running locally, but I can not get it to run on netlify.
Describe the solution you'd like
Being able to set remix config to
serverModuleFormat: "cjs"
and deploy to netlify.Describe alternatives you've considered
I tried creating a fresh remix project from this starter and change
serverModuleFormat
tocjs
. It runs fine locally but on netlify the frontpage returns 404 and opening the handler directly returns an error:Runtime.HandlerNotFound - server.handler is undefined or not exported
https://bucolic-blini-fa5899.netlify.app and https://bucolic-blini-fa5899.netlify.app/.netlify/functions/server
I also attempted converting our project to esm, but I don't think that's going to happen anytime soon, so we're stuck on remix v1 at the moment
The text was updated successfully, but these errors were encountered: