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
With the combination of the two, when built from a Windows environment, the build output of the server-side JavaScript file .next\server\pages\index.js contains the following require path with double forward slashes.
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Link to the code that reproduces this issue
https://github.com/longzheng/next-transpile-windows-path-repro
To Reproduce
npm install
npm run build
.next
folder onto a Linux/macOS machinenpx next start
Current vs. Expected behavior
Current behaviour
The issue is specific to the combination of two Next.js features, runtime configuration and transpile packages.
runtime configuration https://nextjs.org/docs/pages/api-reference/next-config-js/runtime-configuration
I need to use runtime configuration on the server-side with
getServerSideProps
transpilePackages https://nextjs.org/docs/app/api-reference/next-config-js/transpilePackages
I need to support IE 11 and need to transpile Next.js because otherwise the the client chunks are not ES5 compatible.
With the combination of the two, when built from a Windows environment, the build output of the server-side JavaScript file
.next\server\pages\index.js
contains the followingrequire
path with double forward slashes.Full file here
When built from a Linux/macOS environment, it's
Full file here
(AFAIK if I run the macOS build with Unix path in Windows environment is fine, but the reverse is not.)
Expected behaviour
I expect to be able to build from a Windows environment that can be run in a Linux environment.
I expect the output file
.next\server\pages\index.js
to containVerify canary release
Provide environment information
Which area(s) are affected? (Select all that apply)
Not sure, SWC transpilation
Additional context
No response
The text was updated successfully, but these errors were encountered: