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

Request: Support for moduleResolution "nodenext" and "node16" #644

Closed
SanjoSolutions opened this issue Apr 14, 2024 · 2 comments
Closed

Comments

@SanjoSolutions
Copy link

SanjoSolutions commented Apr 14, 2024

The moduleResolution settings "nodenext" and "node16" require import paths with file extensions. Right now the import paths in the generated TypeScript code have no file extensions. This gives me the error "Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. [..] ts(2835)".

@SanjoSolutions SanjoSolutions changed the title Request: Support for moduleResolution "NodeNext" and "Node16" Request: Support for moduleResolution "nodenext" and "node16" Apr 14, 2024
@SanjoSolutions
Copy link
Author

As a workaround I'm running now sed -Ei 's/(import .* from "\.\/.+)(")/\1.js\2/g' src/protos/*.ts after generating the TypeScript, which adds the ".js" extensions.

@timostamm
Copy link
Owner

Duplicate of #182

@timostamm timostamm marked this as a duplicate of #182 Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants