-
-
Notifications
You must be signed in to change notification settings - Fork 17
Resolve failed when the same name file and directory #13
Comments
Hmm, I'm not sure if this is a bug. When you import a path Besides, since this is how Node.js resolves it (rename your files to |
I think a better way is to be consistent with
Also, native ESM has no default extension and resolve |
To use Node.js's classic resolution algorithm, you can use the $ node --loader @esbuild-kit/esm-loader --experimental-specifier-resolution=node src/index.js
(node:34643) ExperimentalWarning: --experimental-loader is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
(node:34643) ExperimentalWarning: The Node.js specifier resolution flag is experimental. It could change or be removed at any time.
bar Or with tsx: $ npx tsx --experimental-specifier-resolution=node src/index.js
bar With this flag, users have a way to toggle between both resolution algorithms. If we override the default behavior to force Node's classic resolution algorithm, users will be limited to one behavior. For this reason, I don't think we should change it. I agree we should try to resolve |
Reproduction: https://github.com/sxzz/esbuild-esm-loader-issue
If rename or remove
src/utils
, it works.IMHO, the problem caused by here.
esm-loader/src/loaders.ts
Lines 79 to 81 in 0d64195
The text was updated successfully, but these errors were encountered: