When I have a pipe on a component, the language service tells me it can't find it - even though the app builds without a problem and the pipe is correctly detected.
Yep I've got the same problem! I've got the pipe defined in a shared module, and in the feature module I've imported the shared module.
Builds fine, but it's not detected in the language service.
@aaron-bond Do you have a repo or a .zip file that reproduces this issue?
Same here. I see this happen when the pipe's module is imported in a SharedModule, included in that module's exports, and then imported into a feature module. Components in the feature module will show this error.
I have the exact same problem as @rolandoldengarm . My pipe is defined in, and exported from, a SharedModule. The SharedModule is imported into my AppModule. app.component.html uses my pipe, but VSCode shows the error The pipe 'pipeNameHere' could not be found..
I had an issue exactly as described in this post. But it was because I referred to the pipes in an incorrect manner. Not angular.
I had a pipe like:
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'url'
})
export class UrlPipe implements PipeTransform {
transform(value: string ): string {
return `url(${value})`;
}
}
and in the template I would refer to it as:
<div [style.background]="backgroundUrl | UrlPipe">
This would result in the exact situation described in this issue. However I should have refered to the name defined in the @Pipe decorator and not the name of the class ( which is used to register it in your module ).
<div [style.background]="backgroundUrl | url">
I am not sure if this will solve the issues described ( since there isn't a lot of code provided ). But it just might be what happened.
Did anyone got work around for the issue.
Closing this, since original issue is more than two years old. If problem persists, please open a new issue with screenshot, code example, and log information. Thanks!
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
Yep I've got the same problem! I've got the pipe defined in a shared module, and in the feature module I've imported the shared module.
Builds fine, but it's not detected in the language service.