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
used the search to make sure that a similar issue hasn't already been submit
Expected Behavior
I work in a Typescript mono-repo, where all our imports are bare imports instead of relative imports. We define exports and imports in package.json to control what each package exports. It would be great if tsoa knew how to resolve these imports.
Generate routes error.
GenerateMetadataError: No declarations found for referenced type User.
at TypeResolver.getModelTypeDeclarations (/Users/philliphuang/tsoa-repro/node_modules/@tsoa/cli/dist/metadataGeneration/typeResolver.js:871:62)
at TypeResolver.calcRefTypeName (/Users/philliphuang/tsoa-repro/node_modules/@tsoa/cli/dist/metadataGeneration/typeResolver.js:536:39)
at TypeResolver.calcTypeReferenceTypeName (/Users/philliphuang/tsoa-repro/node_modules/@tsoa/cli/dist/metadataGeneration/typeResolver.js:712:34)
at TypeResolver.getReferenceType (/Users/philliphuang/tsoa-repro/node_modules/@tsoa/cli/dist/metadataGeneration/typeResolver.js:721:35)
at TypeResolver.resolveTypeReferenceNode (/Users/philliphuang/tsoa-repro/node_modules/@tsoa/cli/dist/metadataGeneration/typeResolver.js:468:21)
at TypeResolver.resolve (/Users/philliphuang/tsoa-repro/node_modules/@tsoa/cli/dist/metadataGeneration/typeResolver.js:293:21)
at TypeResolver.resolveTypeReferenceNode (/Users/philliphuang/tsoa-repro/node_modules/@tsoa/cli/dist/metadataGeneration/typeResolver.js:458:93)
at TypeResolver.resolve (/Users/philliphuang/tsoa-repro/node_modules/@tsoa/cli/dist/metadataGeneration/typeResolver.js:293:21)
at MethodGenerator.Generate (/Users/philliphuang/tsoa-repro/node_modules/@tsoa/cli/dist/metadataGeneration/methodGenerator.js:62:78)
at /Users/philliphuang/tsoa-repro/node_modules/@tsoa/cli/dist/metadataGeneration/controllerGenerator.js:46:41
error Command failed with exit code 1.
These fields have been around since ~Node 12 and all major tooling (e.g. Typescript, bundlers) know how to understand them.
Currently, I can hack around this issue by passing custom tsconfig options to tsoa. But this is not ideal because I have to define the import paths in 2 different locations (package.json and in tsoa).
Breaking change?
This could break generation depending on what users have defined in their exports or imports in package.json.
The text was updated successfully, but these errors were encountered:
Sorting
I'm submitting a ...
I confirm that I
Expected Behavior
I work in a Typescript mono-repo, where all our imports are bare imports instead of relative imports. We define
exports
andimports
in package.json to control what each package exports. It would be great if tsoa knew how to resolve these imports.See https://github.com/JavaScriptBach/tsoa-repro for an example.
Current Behavior
tsoa does not know how to resolve these imports:
Steps to Reproduce
https://github.com/JavaScriptBach/tsoa-repro
Context (Environment)
Version of the library: 6.4.0
Version of NodeJS: 18.14.0
Detailed Description
It would be nice if tsoa understand how to resolve these fields:
These fields have been around since ~Node 12 and all major tooling (e.g. Typescript, bundlers) know how to understand them.
Currently, I can hack around this issue by passing custom tsconfig options to tsoa. But this is not ideal because I have to define the import paths in 2 different locations (package.json and in tsoa).
Breaking change?
This could break generation depending on what users have defined in their
exports
orimports
in package.json.The text was updated successfully, but these errors were encountered: