Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERR_UNSUPPORTED_DIR_IMPORT has hard to parse Grammar #40973

Open
bgolding355 opened this issue Nov 25, 2021 · 2 comments
Open

ERR_UNSUPPORTED_DIR_IMPORT has hard to parse Grammar #40973

bgolding355 opened this issue Nov 25, 2021 · 2 comments
Labels
errors Issues and PRs related to JavaScript errors originated in Node.js core. esm Issues and PRs related to the ECMAScript Modules implementation.

Comments

@bgolding355
Copy link

Version

27b1088

Platform

Linux bgolding 5.11.0-40-generic #44~20.04.2-Ubuntu SMP Tue Oct 26 18:07:44 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Subsystem

esm/resolve

What steps will reproduce the bug?

Trigger the ERR_UNSUPPORTED_DIR_IMPORT error

How often does it reproduce? Is there a required condition?

100% iff you trigger this error

What is the expected behavior?

A grammatically comprehensible sentence.

Possibly:

Directory import '/home/bgolding/Desktop/test/node_modules/@angular/compiler-cli/ngcc' is not supported, resolving ES modules imported from /home/bgolding/Desktop/test/testing/node_modules/ng-packagr/lib/utils/ng-compiler-cli.js

Assuming this error means that:

  1. It is not possible to import a directory, but
  2. It is possible to import /home/bgolding/Desktop/test/testing/node_modules/ng-packagr/lib/utils/ng-compiler-cli.js as an alternative to that directory

Alternatively:

Directory import '/home/bgolding/Desktop/test/node_modules/@angular/compiler-cli/ngcc' is not supported while resolving ES modules imported from /home/bgolding/Desktop/test/testing/node_modules/ng-packagr/lib/utils/ng-compiler-cli.js

If this error means that:

  1. It is not possible to import a directory, AND
  2. It was trying to resolve an import from /home/bgolding/Desktop/test/testing/node_modules/ng-packagr/lib/utils/ng-compiler-cli.js

What do you see instead?

Directory import '/home/bgolding/Desktop/test/node_modules/@angular/compiler-cli/ngcc' is not supported resolving ES modules imported from /home/bgolding/Desktop/test/testing/node_modules/ng-packagr/lib/utils/ng-compiler-cli.js

Additional information

node/lib/internal/errors.js

Lines 1578 to 1579 in 27b1088

E('ERR_UNSUPPORTED_DIR_IMPORT', "Directory import '%s' is not supported " +
'resolving ES modules imported from %s', Error);

https://stackoverflow.com/questions/64449464/error-err-unsupported-dir-import-directory-import-when-attempting-to-start-no

@iam-frankqiu iam-frankqiu added the linux Issues and PRs related to the Linux platform. label Nov 26, 2021
@Trott
Copy link
Member

Trott commented Nov 26, 2021

@nodejs/modules

@Trott Trott added errors Issues and PRs related to JavaScript errors originated in Node.js core. esm Issues and PRs related to the ECMAScript Modules implementation. and removed linux Issues and PRs related to the Linux platform. labels Nov 26, 2021
@guybedford
Copy link
Contributor

Thanks for sharing the case here @bgolding355, the clearer we can make this the better. At least the fix was at least relatively clear despite the wording.

I think resolving ES module without the plural is the direct grammar fix.

Perhaps we can make a rewording along the lines of is not supported by the ES module resolver imported from or similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
errors Issues and PRs related to JavaScript errors originated in Node.js core. esm Issues and PRs related to the ECMAScript Modules implementation.
Projects
None yet
Development

No branches or pull requests

4 participants