0

I added a new shared library with a pipe ( RemoveUnderscorePipe ). I'm using the library an angular app. The app using the library compiles and works fine. The issue is that in vs-code there are errors in all templates using the pipe: enter image description here

This makes the developer experience less enjoyable, and go to definition on pipe name does not work either.

I found a similar question: Unable to resolve signature for pipe invocation in vscode by Angular Language Service And have tried the suggested solution without success.

How can I make the vscode recognize the library. Thanks.

Gama11
  • 31,714
  • 9
  • 78
  • 100
Eli
  • 1,670
  • 1
  • 20
  • 23
  • If you are using Angular extension, make sure the library is correctly added in `angular.json`. Otherwise, try to reset VSCode few times - I remember it took me at least 3 resets for VSCode to "wake up" – Jiri Kralovec Aug 03 '20 at 09:52
  • The question might look stupid but have you imported the pipe's module correctly? – C.Champagne Aug 03 '20 at 10:00
  • The application compiles and works correctly. The only issue is in vscode. – Eli Aug 03 '20 at 10:55

2 Answers2

0

So, in Early August 2020 vs code angular language services need to be restarted after library is built. And the library must be built with --prod flag. Found answer here: https://github.com/angular/vscode-ng-language-service/issues/645#issuecomment-587282612

Eli
  • 1,670
  • 1
  • 20
  • 23
0

I could solve this problem by not using a default export for my pipe.

Instead of

export default class PricePipe implements PipeTransform {}

Do

export class PricePipe implements PipeTransform {
pubkey
  • 617
  • 8
  • 17