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

Missing d.ts files #669

Closed
TeraNovaLP opened this issue Jun 22, 2020 · 9 comments
Closed

Missing d.ts files #669

TeraNovaLP opened this issue Jun 22, 2020 · 9 comments
Labels
Milestone

Comments

@TeraNovaLP
Copy link

Hello, I've encountered a problem with the Typescript definition files.

In the affected project definitions are created for all files except two, which I can't explain.

Thanks for your help!

Affected project: https://gitlab.com/sokkuri/kogitte

I miss the definitions for these files:

  • models/AuthData.ts
  • models/SignInData.ts
@marvinhagemeister
Copy link
Collaborator

marvinhagemeister commented Jun 22, 2020

Can confirm that this is an upstream bug in https://github.com/ezolenko/rollup-plugin-typescript2 and not in microbundle . Also tried Using TypeScript directly without a bundler works fine. My guess is that the generation emit happens too late or that the file is treated as being empty (the class is only used as an interface in the code).

Moving the unused classes into AuthResult.ts seems to work around that problem, but that's a workaround at best.

cc @ezolenko

@saurabhnemade
Copy link

I have also faced this problem.
What I ended up doing was introducing new script in package.json and run it manually when I need to emit typess:

"copy-dts": "copyfiles -u 1 \"src/**/*.d.ts\" dist",

But I would also like a permanent solution with which I can just run my own command so I can copy types or package should do this.

@hbroer
Copy link

hbroer commented Aug 13, 2020

Same problem here. I have a types.ts file which only exports a few types so the implementation file is not full of types and this file is not exported to types.d.ts. I will move the types to the implementation until it got fixed.

@geemanjs
Copy link

geemanjs commented Oct 29, 2020

I hit the same problem.. For anyone just arriving here:

Seems to affect 12.0.1 and above.

I downgraded microbundle to the last known working version 👍

npm install --save [email protected]

@AndyOGo
Copy link

AndyOGo commented Nov 22, 2020

downgrading to npm install --save-dev [email protected]

@developit
Copy link
Owner

developit commented Dec 18, 2020

Microbundle 0.13 includes a new version of rollup-plugin-typescript2, hopefully it fixes this bug.

I'm going to close it assuming it did, please re-open if it's still an issue.

@developit developit added this to the 0.13.0 milestone Dec 18, 2020
MatejBransky pushed a commit to MatejBransky/toolkit that referenced this issue Jan 2, 2021
issue with `rollup-plugin-typescript2` (developit/microbundle#669 (comment))
@rhyek
Copy link

rhyek commented May 22, 2021

I'm using 0.13 and a file with only types exports is not being emitted. Tried 0.12 and it does emit them now.

@rschristian
Copy link
Collaborator

@rhyek Can you open a new issue? The problem outlined here was corrected. Whatever you're seeing is not the same thing, and we'd need information on your setup / what your issue is in order to provide help.

@agilgur5
Copy link
Contributor

agilgur5 commented Sep 17, 2022

Same problem here. I have a types.ts file which only exports a few types so the implementation file is not full of types and this file is not exported to types.d.ts. I will move the types to the implementation until it got fixed.

I'm using 0.13 and a file with only types exports is not being emitted. Tried 0.12 and it does emit them now.

Thought I'd update here that I fixed the root cause upstream in ezolenko/rollup-plugin-typescript2#406, which was released in rpt2 0.34.0.

There shouldn't be a difference between those two microbundle versions though, as this has been a long-standing issue in rpt2 since day 1 basically. There may be a difference with your tsconfig include though.

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

No branches or pull requests

10 participants