Skip to content

private fields compilation errors due to module paths not being recognized as referring to the same module #1906

@Benjamin-Dobell

Description

@Benjamin-Dobell

Steps to reproduce

git clone git@github.com:BreakaClub/tsgo-bug-1.git
cd tsgo-bug-1
pnpm i
pnpm build

Leads to the error:

tsgo --build

src/index.ts:7:13 - error TS2345: Argument of type 'import("/Users/ben/Development/tsgo-bug-1/pkg2/node_modules/.pnpm/kysely@0.28.8/node_modules/kysely/dist/esm/kysely").Kysely<any>' is not assignable to parameter of type 'import("/Users/ben/Development/tsgo-bug-1/pkg1/node_modules/.pnpm/kysely@0.28.8/node_modules/kysely/dist/esm/kysely").Kysely<any>'.
  Property '#private' in type 'Kysely' refers to a different member that cannot be accessed from within type 'Kysely'.

7 wantsKyself(db);
              ~~


Found 1 error in src/index.ts:7

Behavior with typescript@5.8

tsc 5.8 is available for convenience in the same repository. Simply execute:

pnpm build-tsc

This builds to completion without an error.

Behavior with tsgo

As above:

pnpm build

Leads to:

> tsgo --build

src/index.ts:7:13 - error TS2345: Argument of type 'import("/Users/ben/Development/tsgo-bug-1/pkg2/node_modules/.pnpm/kysely@0.28.8/node_modules/kysely/dist/esm/kysely").Kysely<any>' is not assignable to parameter of type 'import("/Users/ben/Development/tsgo-bug-1/pkg1/node_modules/.pnpm/kysely@0.28.8/node_modules/kysely/dist/esm/kysely").Kysely<any>'.
  Property '#private' in type 'Kysely' refers to a different member that cannot be accessed from within type 'Kysely'.

7 wantsKyself(db);
              ~~


Found 1 error in src/index.ts:7

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