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

Faulty bundled d.ts file generated from API Explorer #160

Open
3 tasks
andreas-karlsson opened this issue Jun 4, 2024 · 0 comments
Open
3 tasks

Faulty bundled d.ts file generated from API Explorer #160

andreas-karlsson opened this issue Jun 4, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@andreas-karlsson
Copy link
Contributor

tsc includes a export {} statement in namespaces in built d.ts files. When api-extractor bundles these files it translates the export statement to simply {}; which is invalid and gives the error TS1036: Statements are not allowed in ambient contexts. when consumers are using the library whith skipLibCheck:false.

Expected Behavior

Our build process should generate valid d.ts files.

Possible Solution

The real solution is to get this fixed in api-extractor, in the meantime though, we could hack around it by adding a process to remove the faulty statements. It's doable as a simple text transform. In any case we should add a step to verify that our bundled d.ts files are valid.

  • Open an issue with api-extractor
  • Add a fix to the bundle process
  • Add a step to verify the bundle with tsc
@andreas-karlsson andreas-karlsson added the bug Something isn't working label Jun 4, 2024
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

1 participant