Repository navigation
Conversation
… workers don't crash on import Webpack-built OpenNext workers have an empty `__filename`, so the module-scope `createRequire` in `config/util` threw as soon as the server entry was imported, failing the instrumentation hook on every request.
size-limit report 📦
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5176777. Configure here.
| /*! rollup-include-cjs-only-end */ | ||
| /*! rollup-include-esm-only */ | ||
| sdkRequire = createRequire(import.meta.url); | ||
| /*! rollup-include-esm-only-end */ |
There was a problem hiding this comment.
Missing regression test for import crash
Low Severity
This fix PR does not add a unit, integration, or E2E test for the regression, which the testing convention requires. A unit test can assert that importing the helper does not invoke createRequire, without a Cloudflare worker app. Flagged because it is called out in the review rules.
Triggered by project rule: PR Review Guidelines for Cursor Bot
Reviewed by Cursor Bugbot for commit 5176777. Configure here.
There was a problem hiding this comment.
It requires a new specific e2e test app that runs Next 15 + OpenNext without any edge routes, our current apps cannot house such a test. I didn't want to do that for a v10.
Will leave this for reviewers to decide.


Webpack-built OpenNext workers have an empty
__filename, so the module-scopecreateRequireinconfig/utilthrew on import and failed the instrumentation hook, fixed by creating that require insideresolveNextjsPackageJson.To test this properly we would need to add an app specifically to test this, which doesn't seem worth it for v10. This issue doesn't occur in v11 because the server entry no longer exports config paths, so the
createRequirecall is never evaluated.closes #25683