GitXplorerGitXplorer
h

typescript-paths-inferred-type-cannot-be-named

public
0 stars
0 forks
0 issues

Commits

List of commits on branch main.
Verified
477cdc95708156b730c6debba22a8c97f49c7eb2

Reproduce bug

hhaines committed 10 months ago

README

The README file for this repository.

Setting paths in lib's tsconfig breaks app

We've got a multiproject build where app depends on lib.

lib exports a client function that creates a Connect RPC client from a service definition.

This compiles fine until we add a paths section to lib's tsconfig, at which point app's build fails with

app/src/client.ts:4:14 - error TS2742: The inferred type of 'example' cannot be named without a reference to '../../node_modules/@ahaines/lib/src/api/protobuf/example_pb.js'. This is likely not portable. A type annotation is necessary.

4 export const example = client(Service).example;
               ~~~~~~~

To see it in action, run

$ npm install
$ npm run repro

To bisect it, I ran

$ every-ts bisect start v5.4.2 v5.3.3
$ every-ts bisect run ./repro