Skip to content

When dependencies are installed with pnpm, ts-loader behaves differently than tsc #768

@weichensw

Description

@weichensw

Expected Behaviour

ts-loader should not report TS2305

Actual Behaviour

ts-loader report TS2305 error

Steps to Reproduce the Problem

  1. clone https://github.com/xbtsw/typescript-pnpm
  2. npm i -g pnpm
  3. pnpm install
  4. run npm run tsc and observe that the compilation success
  5. run npm start and observe error

This happens to both Linux and Windows 10 host.

Location of a Minimal Repository that Demonstrates the Issue.

https://github.com/xbtsw/typescript-pnpm

It looks like the type information is not visible to TypeScript when the dependency are symlinked and are compiled via ts-loader. I am willing to look into it but not sure where to start.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions