-
Notifications
You must be signed in to change notification settings - Fork 27k
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
Worker not compiling correctly, window is undefined in files after canary 14.0.5-canary.19 #60644
Comments
some one checking on this ? is being a blocker to update after .19 canary |
plesaee some one can take care of this, this is a blocker. nextjs cant be used any more if you are using workers. |
related: |
@yf-yang you close something that still happening and is related to this |
Problematic release: https://github.com/vercel/next.js/releases/tag/v14.0.5-canary.20 |
Doesn't seem to work on 14.1.1-canary.42 as well |
Isn't it a correct behavior?
|
not it is not, this was working before perfeclty |
) Disable swc transform optimizer for node_modules in browser layer of app router bundles Fixes #61858 Fixes #60644 Fixes #60920 Fixes #61740 Closes NEXT-2418 In browser there could be not only one runtime, it could have both js worker and browser. In js worker the `typeof window` is not as same as in browser, so disabling the swc optimizer which will replace the code. Leave the condition as it as.
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://codesandbox.io/p/devbox/trusting-glade-g3l38y?file=%2Fapp%2Fpage.tsx%3A7%2C1
To Reproduce
pnpm install
pnpm dev
show the console and see the window is undefined
Current vs. Expected behavior
window var is undefined and should be defined as this is in the browser context
Verify canary release
Provide environment information
Which area(s) are affected? (Select all that apply)
App Router, SWC transpilation
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
canary 14.0.5-canary.19 works perfectly
The text was updated successfully, but these errors were encountered: