Describe the bug
The plugin does not currently support the Vite Environment API build model. So, when the future flag for the Vite Environment API build model is set to "true" the site does not properly deploy on netlify.
To Reproduce
- Go to the site's react-router.config.ts file.
- Set the config's future >> v8_viteEnvironmentApi value to true. For example:
{
...
future: {
v8_viteEnvironmentApi: true,
}
- Deploy the site to Netlify.
- Navigate to the site.
- The site will throw a 404 error because the react-router server handler function is not build during deployment.
Expected behavior
During deployment, the react-router server handler function should be created.
Desktop (please complete the following information):
- OS: Windows
- Browser chrome
- Version 148.0.7778.97
Additional context
Per Copilot, the issue occurs because the flag changes how Vite runs the SSR build from the old "isSsrBuild" model to the new Environment API model. The Netlify plugin checks isSsrBuild === true to know it should inject its server.js entry point, so that check is never triggered under the new model.
It seems this will definitly need to be addressed before react-router moves to version 8. Currently, the workaround is to set the v8_viteEnvironmentApi flag to false, which will not be possible in v8.
Describe the bug
The plugin does not currently support the Vite Environment API build model. So, when the future flag for the Vite Environment API build model is set to "true" the site does not properly deploy on netlify.
To Reproduce
Expected behavior
During deployment, the react-router server handler function should be created.
Desktop (please complete the following information):
Additional context
Per Copilot, the issue occurs because the flag changes how Vite runs the SSR build from the old "isSsrBuild" model to the new Environment API model. The Netlify plugin checks isSsrBuild === true to know it should inject its server.js entry point, so that check is never triggered under the new model.
It seems this will definitly need to be addressed before react-router moves to version 8. Currently, the workaround is to set the v8_viteEnvironmentApi flag to false, which will not be possible in v8.