-
Notifications
You must be signed in to change notification settings - Fork 90
fix: handle edge runtime pages and middleware for turbopack builds #3009
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
Conversation
📊 Package size report 0.01%↑
Unchanged files
🤖 This report was automatically generated by pkg-size-action |
parts.push( | ||
`const middlewareEntryKey = Object.keys(_ENTRIES).find(entryKey => entryKey.startsWith("middleware_${name}"));`, | ||
// turbopack entries are promises so we await here to get actual entry | ||
// non-turbopack entries are already resolved, so await does not change anything | ||
`export default await _ENTRIES[middlewareEntryKey].default;`, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the only real change here is adding await
to exported value, but I did very small change to add some context about that in comment
@@ -105,6 +105,7 @@ export const copyNextServerCode = async (ctx: PluginContext): Promise<void> => { | |||
`server/*`, | |||
`server/chunks/**/*`, | |||
`server/edge-chunks/**/*`, | |||
`server/edge/chunks/**/*`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needed for edge runtime pages when building with turbopack
server/edge-chunks
seems to contain things like assets and wasm files (?) for middleware for non-turbopack builds
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
Follow up to #2987
This will attempt to adjust handling to fix:
Previous PR did adjust setup for nodejs pages, but that is not sufficient for full coverage
Documentation
Tests
Expanded turbopack fixture and tests to test edge runtime pages and middleware
Relevant links (GitHub issues, etc.) or a picture of cute animal