You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At line 327, the resolvedExternalPackageDirs is initialized at the first invocation of async handleExternals(). However, the content of resolvedExternalPackageDirs will not be populated until line 342.
Another invocation of async handleExternals() will skip initializing resolvedExternalPackageDirs, as it is already a Map instance. So, it will continue to line 347 and pass resolvedExternalPackageDirs to resolveBundlingOptOutPackages.
RACE: Depending on the execution of the first invocation, the content in resolvedExternalPackageDirs may or may not be populated. The resolvedBundlingOptOutRes is undetermined.
Current vs. Expected behavior
current:
external dependencies may not be resolved when calling resolveBundlingOptOutPackages. Which causes random build failures, like rustwasm/wasm-pack#1402.
expected:
external dependencies must be resolved first.
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 24.1.0: Thu Oct 10 21:03:11 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T6020
Available memory (MB): 32768
Available CPU cores: 12
Binaries:
Node: 22.11.0
npm: 10.9.0
Yarn: 1.22.22
pnpm: N/A
Relevant Packages:
next: 15.1.6 // There is a newer version (15.1.7) available, upgrade recommended!
eslint-config-next: 15.1.5
react: 18.3.1
react-dom: 18.3.1
typescript: 5.7.3
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
Webpack
Which stage(s) are affected? (Select all that apply)
next build (local), next dev (local), next start (local)
Additional context
No response
The text was updated successfully, but these errors were encountered:
Link to the code that reproduces this issue
https://github.com/ashi009/nextjs-wasm
To Reproduce
next.js/packages/next/src/build/handle-externals.ts
Lines 327 to 346 in a71a764
At line 327, the
resolvedExternalPackageDirs
is initialized at the first invocation ofasync handleExternals()
. However, the content ofresolvedExternalPackageDirs
will not be populated until line 342.next.js/packages/next/src/build/handle-externals.ts
Lines 347 to 356 in a71a764
Another invocation of
async handleExternals()
will skip initializingresolvedExternalPackageDirs
, as it is already aMap
instance. So, it will continue to line 347 and passresolvedExternalPackageDirs
toresolveBundlingOptOutPackages
.RACE: Depending on the execution of the first invocation, the content in
resolvedExternalPackageDirs
may or may not be populated. TheresolvedBundlingOptOutRes
is undetermined.Current vs. Expected behavior
current:
external dependencies may not be resolved when calling
resolveBundlingOptOutPackages
. Which causes random build failures, like rustwasm/wasm-pack#1402.expected:
external dependencies must be resolved first.
Provide environment information
Which area(s) are affected? (Select all that apply)
Webpack
Which stage(s) are affected? (Select all that apply)
next build (local), next dev (local), next start (local)
Additional context
No response
The text was updated successfully, but these errors were encountered: