Skip to content

Named class expression extending import-aliased class does not bundle correctly #4273

@dmp-gottschalk

Description

@dmp-gottschalk

Description

When extending a class, which was imported and aliased, in a class expression, using the same name, there will be a name clash after bundeling.
This will throw a ReferenceError: Cannot access 'ClassName' before initialization at runtime, every time the class expression gets executed.

Minimal Reproduction

https://esbuild.github.io/try/#YgAwLjI1LjkALS1idW5kbGUAZQBlbnRyeS50cwBpbXBvcnQgeyBNeVNlcnZpY2UgYXMgUmVhbE15U2VydmljZSB9IGZyb20gJy4vbXktc2VydmljZSc7CgpleHBvcnQgY29uc3QgZmFjdG9yeSA9ICgpID0+IG5ldyAoY2xhc3MgTXlTZXJ2aWNlIGV4dGVuZHMgUmVhbE15U2VydmljZSB7IH0pAABteS1zZXJ2aWNlAGV4cG9ydCBjbGFzcyBNeVNlcnZpY2UgeyAKCn0

Originally reported at angular/angular-cli#31052

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions