Skip to content

Type error only through ts-loader #637

Closed

Description

@quicksnap

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?

Activity

  1. johnnyreilly commented on Sep 19, 2017

    @johnnyreilly
    Member

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

  2. quicksnap commented on Sep 19, 2017

    @quicksnap
    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

  3. johnnyreilly commented on Sep 19, 2017

    @johnnyreilly
    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

  4. quicksnap commented on Sep 19, 2017

    @quicksnap
    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.

  5. quicksnap commented on Sep 19, 2017

    @quicksnap
    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.

  6. johnnyreilly commented on Sep 20, 2017

    @johnnyreilly
    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

  7. quicksnap commented on Sep 20, 2017

    @quicksnap
    Author

    Totally understand. It's really baffling..

  8. elldritch commented on Dec 9, 2017

    @elldritch

    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.

  9. johnnyreilly commented on Dec 9, 2017

    @johnnyreilly
    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.

  10. elldritch commented on Dec 9, 2017

    @elldritch

    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.

  11. luke-j commented on Apr 23, 2018

    @luke-j

    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 webpack@4.5.0, typescript@2.7.2 & ts-loader@4.2.0 with node 8.11.0.

  12. johnnyreilly commented on Apr 23, 2018

    @johnnyreilly
    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.

  13. lednhatkhanh commented on Jul 31, 2018

    @lednhatkhanh

    Hello, any updates on this?

  14. stale commented on Jan 19, 2019

    @stale

    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.

  15. stale commented on Jan 26, 2019

    @stale

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

  16. edbentley commented on Feb 9, 2021

    @edbentley

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions