Skip to content

Error using nested namespaces "UnsupportedSyntaxError: namespace must have a "ModuleBlock" body." #79

@danielpza

Description

@danielpza

Problem

I get this error when trying to compile the following with pkgroll:

UnsupportedSyntaxError: namespace must have a "ModuleBlock" body.

declare namespace foo.bar {
  interface A {
    b: string;
  }
}

export { foo };

Seems related to Swatinem/rollup-plugin-dts#246

Expected behavior

bundles it as is, same output as typescript compiler

Minimal reproduction URL

https://github.com/danielpza/pkgroll-namespace-issue

See https://github.com/danielpza/pkgroll-namespace-issue/actions/runs/10288771843/job/28474986787

Version

2.4.2

Node.js version

22.4.1

Package manager

npm

Operating system

Linux

Bugs are expected to be fixed by those affected by it

  • I'm interested in working on this issue

Compensating engineering work financially will speed up resolution

  • I'm willing to offer financial support

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions