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

Silent error on imported type errors #527

Closed
aaronbiser opened this issue Mar 2, 2020 · 2 comments
Closed

Silent error on imported type errors #527

aaronbiser opened this issue Mar 2, 2020 · 2 comments
Labels
kind: bug Something isn't working problem: no repro No reproduction was provided (and have not tried to repro without one) problem: stale Issue has not been responded to in some time scope: upstream Issue in upstream dependency topic: rollup-plugin-typescript2 Issues and PRs relating to rpts2

Comments

@aaronbiser
Copy link

aaronbiser commented Mar 2, 2020

Thanks for creating/maintaining such a great library it's been nice to use but for one issue that I can't seem to resolve.

Current Behavior

If I import a type that has some error the dist files are "Compiled successfully" according to the terminal output but they are not generated in the dist directory. It seems that an error is being thrown that prevents the build because the file does not appear in the dist output but it is not exposed as an error in the terminal output.

In the screenshot under DivProps there is a type being used that is not imported. When the output files are generated to 'dist' you can see that there isn't a file for types.ts
Screen Shot 2020-03-02 at 10 42 47 AM

If I comment out IconProps then types.d.ts is generated.
Screen Shot 2020-03-02 at 10 43 18 AM

If I move the type definitions to the component file instead of importing them I can see the error in the console output as expected. However, I can't move all the types into their respective component files because there will be many shared interfaces and types.

Screen Shot 2020-03-02 at 11 06 07 AM

Screen Shot 2020-03-02 at 10 44 25 AM

It's quite possible that I am completely missing something obvious here but after spending hours searching and trying to resolve the issue I thought I would submit an issue. 🙏

Expected behavior

That an error would be displayed in the terminal output when importing the types. I would expect the error to be the same as the error thrown when the types are added to the component file.

Suggested solution(s)

Checking to see if errors are being thrown but not surfaced to the console output

Additional context

Your environment

Software Version(s)
TSDX 0.12.3
TypeScript 3.8.2
Browser Opera 66.0.3515.115
npm/Yarn 1.19.1
Node v10.15.3
Operating System macOS 10.15.2
@agilgur5
Copy link
Collaborator

agilgur5 commented Mar 4, 2020

Huh, that's a pretty strange error.

It might be related to #500 , which has yet to be released (see #512), but I'm not sure it is. There's a now-deprecated moveTypes() function internally that would have some transient errors that were swallowed (we hit them in CI pretty frequently), but if that were the problem, the types should be generated fine on a retry. Does this error persist after retries?
Even then, moveTypes() is only called once the types exist... a type error would occur before then.

There aren't any other relevant overbroad catches that might silence errors, at least not in TSDX itself (possibly in a dependency upstream). Though it looks like you're running in watch mode? Does it happen with plain tsdx build too?

The only other thing I might take a guess at being a possibility is that this file gets treeshaken out and so doesn't error when it is it's own separate file, but then commenting out code shouldn't make it appear.

Would need a minimal repro to really do any further investigation if that doesn't help. Seems like some weird edge case, might possibly be an error upstream in rollup-plugin-typescript2

@agilgur5 agilgur5 added the problem: stale Issue has not been responded to in some time label Mar 9, 2020
@agilgur5 agilgur5 changed the title Error not thrown on imported type errors Silent error on imported type errors Mar 16, 2020
@agilgur5 agilgur5 added kind: bug Something isn't working problem: no repro No reproduction was provided (and have not tried to repro without one) labels Mar 16, 2020
@agilgur5 agilgur5 added scope: upstream Issue in upstream dependency topic: rollup-plugin-typescript2 Issues and PRs relating to rpts2 labels Sep 17, 2022
@agilgur5
Copy link
Collaborator

Thought I'd update here that once I became a maintainer of rpt2, I found that this issue was upstream in ezolenko/rollup-plugin-typescript2#211.
I recently fixed that upstream issue in ezolenko/rollup-plugin-typescript2#406, which was released in rpt2 0.34.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Something isn't working problem: no repro No reproduction was provided (and have not tried to repro without one) problem: stale Issue has not been responded to in some time scope: upstream Issue in upstream dependency topic: rollup-plugin-typescript2 Issues and PRs relating to rpts2
Projects
None yet
Development

No branches or pull requests

2 participants