You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
first, thanks for this library and the efforts to maintain it!
I've encountered an issue using it in a TypeScript project with Node 16 and moduleResolution set to node16 (or nodenext) in the tsconfig.json.
When the TypeScript models are generated, the import statements in the generated files lack the .js extension for relative file paths. This is problematic because Node 16 requires explicit file extensions in ES module imports: https://nodejs.org/api/esm.html#mandatory-file-extensions
Example Error:
models/contentful-schemes/TypeDiscoverLandingPage.ts:3:48 - error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './TypeBrandCarousel.js'?
Might this be a configurational problem on my end? Unfortunately, I am not able to change module or moduleResolution in my project, but maybe I missed a flag in the library to configure the module compatibility?
Is this a known issue? If so, is there a planned fix?
I'd like to contribute a fix for this issue. For that, could you guide me to the part of the codebase where the import statements are generated?
Thank you!
The text was updated successfully, but these errors were encountered:
Hello,
first, thanks for this library and the efforts to maintain it!
I've encountered an issue using it in a TypeScript project with Node 16 and moduleResolution set to
node16
(ornodenext
) in thetsconfig.json
.When the TypeScript models are generated, the import statements in the generated files lack the .js extension for relative file paths. This is problematic because Node 16 requires explicit file extensions in ES module imports: https://nodejs.org/api/esm.html#mandatory-file-extensions
Example Error:
Incorrect Import Statement:
Expected Import Statement:
tsconfig.json Configuration:
Questions and Offer to Contribute:
module
ormoduleResolution
in my project, but maybe I missed a flag in the library to configure the module compatibility?Thank you!
The text was updated successfully, but these errors were encountered: