Repository navigation
fix(webpack): bump enhanced-resolve to 5.18.4 for #/ subpath imports - #95445
Open
controversial wants to merge 1 commit into
Open
controversial wants to merge 1 commit into
controversial wants to merge 1 commit into
Conversation
controversial
marked this pull request as ready for review
July 3, 2026 15:03
This branch has not been deployed
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.
[NOTE: claude-authored, i have verified the tests & reviewed the diff]
What?
Follow-up to #94461 to enable the identical behavior in Webpack by bumping
enhanced-resolveby one patch version (5.18.3 → 5.18.4)Fixes Webpack failing to resolve imports using the common
"#/*": "./src/*"pattern in package.json imports field.Bumps the vendored
enhanced-resolveto5.18.4(viapnpm.overrides, alongside the existingwebpackpin) and recompilespackages/next/src/compiled/webpack/bundle5.js. Adds an e2e test covering"imports": { "#/*": "./src/*" }for both the app package and an external package.Why?
Brings resolution behavior to parity with
#/nodejs/node#60864)#/microsoft/TypeScript#62844)#/prefixed subpath import specifiers #94461).enhanced-resolvepicked this up in webpack/enhanced-resolve#468 (v5.18.4), but Next.js still vendors 5.18.3, sonext dev --webpack/next build --webpackrejectimport x from "#/foo"withPackage import specifier "#/foo" is not defined/should not start with "#/".How?
"enhanced-resolve": "5.18.4"topnpm.overrides(webpack@5.98.0 depends on^5.17.1, so this stays in-range)bundle5.jsviataskr ncc_webpack_bundle5+ncc_webpack_bundle_packagestest/e2e/app-dir/subpath-imports-slashfixture:package.jsonwith"imports": { "#/*": "./src/*" }, page imports#/greetingnode_modules/external-slash-pkgwith its own"#/*": "./lib/*", forced through the bundler viatranspilePackagestypescript.ignoreBuildErrors: trueso the auto-generated tsconfig (nopaths) does not add aJsConfigPathsPluginalias that would mask theimports-field resolution under testFollow-up to #94461
Refs #94290