import.meta.resolve
doesn't provide a file extension while require.resolve
does.
#4543
Open
2 tasks done
Node.js Version
v20.14.0
NPM Version
v10.7.0
Operating System
Windows 11
Subsystem
Other
Description
I have an ESM file that have the following import statement:
which is throwing an error about not being able to find the file:
same code in CJS env was working (obviously using
lodash
instead oflodash-es
),after investigating I tried resolving instead of importing to check, and here's the result:
as you can see only
lodash-es/keyBy
doesn't have a file extension 🤕is this an expected behavior or did I catch a big fish (jk)?
please correct me I'm missing something here 🙏
Minimal Reproduction
Output
Before You Submit
The text was updated successfully, but these errors were encountered: