-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
TypeScript generates invalid import
for re-exported types
#26985
Comments
@weswigham I created a simpler project to reproduce the problem - https://github.com/raymondfeng/ts-26985. |
Is it expected behavior that the PR that was just merged for this (#27340) seems to break certain For example:
|
Yup. When that error occurs, we would otherwise have written a reference to the module specifier in the message (and you see how bad that is, right?). It's better to require an annotation when we detect a required path like that. |
The issue was reported on #24941 (comment). It was initially discovered in loopbackio/loopback-next#1643.
In this case, MetadataAccessor is exported from @loopback/metadata and re-exported by @loopback/context. Please note that @loopback/repository-json-schema module imports MetadataAccessor from @loopback/context. It leads to incorrectly generated code.
TypeScript Version: 3.0.x and up
Search Terms: TypeScript import types
Code
https://github.com/strongloop/loopback-next/blob/5b27323ba420bfc500fdf9f2762e7292b96ffa0f/packages/repository-json-schema/src/keys.ts
Expected behavior:
TypeScript generates the following code:
Actual behavior:
TypeScript generates invalid code as follows:
Playground Link:
Related Issues:
#24874
The text was updated successfully, but these errors were encountered: