TypeScript-Node-Starter icon indicating copy to clipboard operation
TypeScript-Node-Starter copied to clipboard

pnpm and declarations is true: The inferred type cannot be named without a reference to...

Open dotupNET opened this issue 5 years ago • 2 comments
trafficstars

If you clone the repository and change the tsconfig to use declarations, a lot of "inferred type" errors are thrown.

  "compilerOptions": {
    ...
    "declaration": true,
    ...
The inferred type of 'postForgot' cannot be named without a reference to '.pnpm/registry.npmjs.org/@types/serve-static/1.13.3/node_modules/@types/express-serve-static-core'. This 
is likely not portable. A type annotation is necessary.

I need the declarations in a typescript library for express. But I can't resolve this problem.

does anyone have a solution?

dotupNET avatar Mar 25 '20 07:03 dotupNET

Hey, can you try this fix?: https://github.com/angular/vscode-ng-language-service/issues/657#issuecomment-595610290

peterblazejewicz avatar Mar 25 '20 19:03 peterblazejewicz

Hi, unfortunately that doesn't help either. still behave the same

dotupNET avatar Mar 28 '20 03:03 dotupNET