-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Bad import from d.ts file was left inside declaration bundle #157
Comments
Hey there. I'd like to understand a little more about the structure of your project, as this is not enough for me to go on to reproduce the issue. But if your project structure looks like this:
And export function getData(): MyInterface {
// ...
} Then generating declarations with export declare function getData(): MyInterface; Which is syntactically valid, but semantically an error, since declare function getData(): MyInterface;
export { getData }; In both cases, you should avoid referencing types that you have declared inside ambient contexts ( All of these things said, I'd love to see why an import declaration was left in your bundle, as that is definitely a bug that I'd like to investigate and fix. So if you could provide a minimal repro that causes this behavior, I'll look into it and set up a test case for it. |
Hi @guilhermetod, Have you had a chance to look at my reply yet? As I wrote:
|
Hi @wessberg sorry for the wait. I only now realized I forgot to link the repo I had created to illustrate the issue. In fact, I actually do reference I agree that using |
I'm having a similar issue. The problem is that I have |
Hey there, first, thanks for this library and the support on here. I tried to track down the cause of these issue, but I honestly could not find it. It seems that internal declaration files are not bundled and instead are referenced in an import statement with the original filepath, whch does not exist after build.
Reproduction
Expected Behavior
The content of
src/my-interface.d.ts
gets bundled intoindex.d.ts
Actual Behavior
A import to a non-existing file is created instead
Changing the filename from
my-interface.d.ts
tomy-interface.ts
outputs the expected behavior.The text was updated successfully, but these errors were encountered: