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
It looks as though attempts to resolve external modules got jammed somewhere. Did I forget something? Should I pass something extra? Is it a deliberate deprecation?
The resolved file path (something like ./node_modules/enhanced-resolve/lib/node.js) is printed to stdout.
Found
An error is thrown:
/Users/lalala/thing/node_modules/enhanced-resolve/lib/pathUtils.js:39
switch (p.length) {
^
TypeError: Cannot read property 'length' of undefined
at getType (/Users/lalala/thing/node_modules/enhanced-resolve/lib/pathUtils.js:39:12)
at join (/Users/lalala/thing/node_modules/enhanced-resolve/lib/pathUtils.js:145:10)
at cachedJoin (/Users/lalala/thing/node_modules/enhanced-resolve/lib/pathUtils.js:181:15)
at Resolver.join (/Users/lalala/thing/node_modules/enhanced-resolve/lib/Resolver.js:449:10)
at /Users/lalala/thing/node_modules/enhanced-resolve/lib/ModulesInHierachicDirectoriesPlugin.js:40:50
at Array.map (<anonymous>)
at /Users/lalala/thing/node_modules/enhanced-resolve/lib/ModulesInHierachicDirectoriesPlugin.js:40:32
at Array.map (<anonymous>)
at /Users/lalala/thing/node_modules/enhanced-resolve/lib/ModulesInHierachicDirectoriesPlugin.js:39:14
at _next0 (eval at create (/Users/lalala/thing/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:8:1)
Notes
resolution of local paths works as expected (so filling out './sample' instead of 'enhanced-resolve' correctly yields 'sample.js'
passing process.cwd() instead of "."does resolve to the correct file in node_modules.
passing an explicit modules array to the options -> same error thrown
tried the same with the create resolver and the async samples in the readme (with the same results)
The same code works as expected in enhanced-resolve@latest (currently 4.3.0)
Environment
webpack webpack/enhanced-resolve#master (commit hash: bcf7ee8) against node 14, 12 and 10
Even though v4 wasn't supposed to be able to receive relative paths in lookupStartPath, for ppl migrating from v4 -> v5 it might be unexpected. Should this be documented as a breaking change in i.e. final release notes for v5?
It looks as though attempts to resolve external modules got jammed somewhere. Did I forget something? Should I pass something extra? Is it a deliberate deprecation?
Steps taken
Run the example from the README:
sample.js
Expected
The resolved file path (something like ./node_modules/enhanced-resolve/lib/node.js) is printed to stdout.
Found
An error is thrown:
Notes
process.cwd()
instead of"."
does resolve to the correct file in node_modules.The same code works as expected in enhanced-resolve@latest (currently 4.3.0)
Environment
webpack/enhanced-resolve#master
(commit hash: bcf7ee8) against node 14, 12 and 10(both on OSX 10.15.5)
The text was updated successfully, but these errors were encountered: