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

Type error only through ts-loader #637

Closed
quicksnap opened this issue Sep 19, 2017 · 16 comments
Closed

Type error only through ts-loader #637

quicksnap opened this issue Sep 19, 2017 · 16 comments
Labels

Comments

@quicksnap
Copy link

I posted this question: https://stackoverflow.com/questions/46289856/why-does-a-heterogeneous-result-of-promise-all-cause-a-ts-error

Seems like this error only occurs through ts-loader, and is not erroneous through tsc on its own.

Our project Typescript version is 2.5.2. This error is produced in 2.4.2. Does ts-loader gather its type information from a vendored typescript?

@johnnyreilly
Copy link
Member

No. Do you have a different version of TypeScript in your package.json?

@quicksnap
Copy link
Author

@johnnyreilly I forked the vanilla example and replicated the issue. Steps are in the readme. Should be pretty fast to replicate.

https://github.com/quicksnap/loader-issue

@johnnyreilly johnnyreilly reopened this Sep 19, 2017
@johnnyreilly
Copy link
Member

Hum. That's weird. I'll try and take a look when I get a moment. Not sure when that will be which doesn't help you I know. I'm wondering if it's going to be something to do with typescript 2.4 being installed globally for you or something. Not sure

@quicksnap
Copy link
Author

Could you replicate it? My system doesn't have typescript 2.4 on it anywhere that I can tell. When the yarn.lock also doesn't contain any ts 2.4 resolutions.

I'm at a loss as to what's causing this.

@quicksnap
Copy link
Author

We have a workaround via type hinting in our actual code, so this isn't causing a terrible amount of trouble. But, if it is due to some kind of typescript version mismatch, that could cause other strange behavior down the line.

Thanks for taking a look whenever you get time. I'll try and dig in further when I get a chance as well.

@johnnyreilly
Copy link
Member

Yup I can repro this. I have literally no idea what is causing it. If you can look into it I'll give you all the help I can. I'm afraid I can't look into this myself at present

@quicksnap
Copy link
Author

Totally understand. It's really baffling..

@elldritch
Copy link

I'm seeing weirdness too, where ts-loader's type-checking fails but tsc's type-checking succeeds. For me, the definition of RequestInit in lib.es6.d.ts:6569 is different between the two.

@johnnyreilly
Copy link
Member

To be clear: ts-loader does not package up Typescript. It uses either the version of Typescript installed in your project, or failing that, if Typescript is globally installed that will be used.

@elldritch
Copy link

I futzed around with my global TypeScript installation and got the error warnings to match. My working theory is that my tsc was using the global installation which was at a different version than the typescript installed locally as a devDependency.

@luke-j
Copy link

luke-j commented Apr 23, 2018

Any update on this? TypeScript is not installed anywhere else on my system and it's not particularly obvious to me what could be causing this. Currently on [email protected], [email protected] & [email protected] with node 8.11.0.

@johnnyreilly
Copy link
Member

I'm afraid I don't have time to look at this myself right now. I'd hugely value someone else taking a look and reporting back.

@lednhatkhanh
Copy link

Hello, any updates on this?

@stale
Copy link

stale bot commented Jan 19, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jan 19, 2019
@stale
Copy link

stale bot commented Jan 26, 2019

Closing as stale. Please reopen if you'd like to work on this further.

@stale stale bot closed this as completed Jan 26, 2019
@edbentley
Copy link

In case this helps anyone having this problem: I had a types conflict error because I had the same package installed in different places in a monorepo (even though they were both at the same version). tsc didn't give me any type errors but webpack's module resolution was.

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

6 participants