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
Edge compiler is not choosing browser bundle for module #36844
Comments
We have removed the field picking for In this case, you need to change the imports to |
Related to #36776 |
@wadehammes they're different issues, |
Different yes, but the error output is the same. Middleware is broken in 12.1.6 compared to 12.1.5. I'm assuming due to stricter enforcement of what is allowed to be imported. |
Thanks for the clarification @huozhi. It's not as straightforward for us since debug is used in a shared package (used on all runtimes). We will need to re-evaluate, but for now we have a workaround using a webpack config adjustment.
Between this change and removal of shims for native Node modules (in #36776 mentioned by @wadehammes), just trying to recover from the breaking changes dropped for edge middleware in 12.1.6. All totally expected being beta and all, just caught us by surprise :) Thanks again! |
@ambrauer Yeah that alias solution also works. And thanks for the feedback, we'll try to improve the documentation on our side |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
next dev
Describe the Bug
We utilize the
debug
module in our codebase and are hoping to be able to within edge middleware as well. My understanding is that the edge compiler will favor a browser bundle over the main / node.js bundle if present. See #32369 (comment).However, this doesn't seem to be the case when attempting to use the
debug
module.browser
is defined, yet when running withnext dev
we see the node.js bundle is being used.Expected Behavior
I would expect the browser bundle is used by the edge compiler.
To Reproduce
npm run dev
The text was updated successfully, but these errors were encountered: