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

circular reference in namespace export due to invalid import name #804

Open
IlyaSemenov opened this issue Dec 24, 2022 · 1 comment
Open

Comments

@IlyaSemenov
Copy link

IlyaSemenov commented Dec 24, 2022

A code like this:

import { Foo as Foo1 } from "./foo"

export namespace bar {
  export type Foo = Foo1
}

generates invalid d.ts:

type Foo = string;

declare namespace bar {
    type Foo = Foo; // Type alias 'Foo' circularly references itself. ts(2456)
}

export { bar };

Reproduction: https://stackblitz.com/edit/node-497knk

Run tsup bar.ts --dts and examine dist/bar.d.ts.

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@await-ovo
Copy link
Contributor

It looks like a rollup-plugin-dts issue: Swatinem/rollup-plugin-dts#223

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants