You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the @nrwl/next build executor on Windows, the distDir property of the Next.js config object that gets generated has backslashes in it instead of Posix-style forward slashes. This is a bug in the corner case of building a Next.js app on Windows and then deploying that build on Linux. My team currently does this, and ran into an error in how distDir gets serialized into the generated file that controls the location of server-side code to be executed when visiting a page that uses the getServerSideProps API. When visiting that page in our application, it crashes and the page shows this plain text:
{"errorType":"Error","errorMessage":"Could not find a production build in the '/var/task/apps/spatial-web/..\\..\\dist\\apps\\spatial-web\\.next' directory. Try building your app with 'next build' before starting the production server. https://nextjs.org/docs/messages/production-start-no-build-id","trace":["Error: Could not find a production build in the '/var/task/apps/spatial-web/..\\..\\dist\\apps\\spatial-web\\.next' directory. Try building your app with 'next build' before starting the production server. https://nextjs.org/docs/messages/production-start-no-build-id"," at NextNodeServer.getBuildId (/var/task/node_modules/next/dist/server/next-server.js:114:23)"," at new Server (/var/task/node_modules/next/dist/server/base-server.js:92:29)"," at new NextNodeServer (/var/task/node_modules/next/dist/server/next-server.js:73:9)"," at getBridge (/var/task/.netlify/functions-internal/___netlify-handler/___netlify-handler.js:46:28)"," at Runtime.handler (/var/task/.netlify/functions-internal/___netlify-handler/___netlify-handler.js:75:46)"," at Runtime.handleOnce (/var/runtime/Runtime.js:66:25)"]}
Note the mixed style in /var/task/apps/spatial-web/..\..\dist\apps\spatial-web\.next
Expected Behavior
It's expected that the distDir parameter always has a Posix-style format.
We discovered that by hard-coding the distDir property in the next.config.js to the expected Posix-style path (../../dist/apps/spatial-web), things work as expected.
I don't think this is a regression.
Steps to Reproduce
Generate a new application use @nrwl/next
Make a new page that uses getServerSideProps
Build the app on a Windows machine, then deploy the built app on a Unix machine. (We ran into this using the Netlify CLI to build and deploy.)
Current Behavior
When using the @nrwl/next build executor on Windows, the
distDir
property of the Next.js config object that gets generated has backslashes in it instead of Posix-style forward slashes. This is a bug in the corner case of building a Next.js app on Windows and then deploying that build on Linux. My team currently does this, and ran into an error in howdistDir
gets serialized into the generated file that controls the location of server-side code to be executed when visiting a page that uses thegetServerSideProps
API. When visiting that page in our application, it crashes and the page shows this plain text:Note the mixed style in /var/task/apps/spatial-web/..\..\dist\apps\spatial-web\.next
Expected Behavior
It's expected that the
distDir
parameter always has a Posix-style format.We discovered that by hard-coding the
distDir
property in thenext.config.js
to the expected Posix-style path (../../dist/apps/spatial-web
), things work as expected.I don't think this is a regression.
Steps to Reproduce
getServerSideProps
getServerSideProps
.Environment
The text was updated successfully, but these errors were encountered: