feat(nextjs): Use not: foreign condition in turbopack loaders#19502
Open
feat(nextjs): Use not: foreign condition in turbopack loaders#19502
not: foreign condition in turbopack loaders#19502Conversation
packages/nextjs/src/config/turbopack/generateValueInjectionRules.ts
Outdated
Show resolved
Hide resolved
Contributor
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.
| } | ||
|
|
||
| return major >= 16; | ||
| } |
There was a problem hiding this comment.
Condition gating may fail on canaries
Medium Severity
supportsTurbopackRuleCondition gates on parseSemver(version).major >= 16, which may return undefined for common Next.js version formats like canary/prerelease strings, causing the condition field to be omitted even when Turbopack supports it.
Additional Locations (1)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Just came across https://nextjs.org/docs/app/api-reference/config/next-config-js/turbopack#advanced-webpack-loader-conditions when researching for another issue.
We can match the turbopack loaders more strictly to only run on user code. Potentially reduces build times.
Closes #19504 (added automatically)