Closed SanjoSolutions closed 7 months ago
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.
Duplicate of https://github.com/timostamm/protobuf-ts/issues/182
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)".