Skip to content
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

Declaration output can be incorrect when an import has a name conflict with an export #88

Closed
andrewstart opened this issue Mar 11, 2020 · 2 comments
Labels
Bug Something isn't working

Comments

@andrewstart
Copy link

Example project: https://github.com/andrewstart/rollup-ts-bug

The .d.ts output is incorrect in this specific situation:

  1. First exported module exports a reference to A from an external module.
  2. Second exported module exports its own, unrelated A.
  3. Third exported module exports a reference to A from that same external module.

In this situation, the A reference for the third module is instead a reference to the internally renamed A module.

@wessberg
Copy link
Owner

Hey there. Thanks for the repro! I've identified and resolved the issue in v1.2.23

@andrewstart
Copy link
Author

Hmm, that seems to have introduced a new issue where it is declaring an internal namespace and potentially putting some classes in it that should be at the top level. With my odd setup, if I imported the majority of my library (into specific file A) one way the internal namespace had the internal library names of the contents (and was also trying to import from an external module, which is always an error in internal namespaces), and imported another way the namespace was present but empty and the contents of that specific file A were trying to reference the namespace.

When I get a chance I'll update my example project with a minimum repro and open a new issue for that, as it seems to be potentially bigger than just name conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants