2

WebStorm gives me

Cyclic dependency between: AComponent -> BComponent -> CComponent -> AComponent 

even though I use

forwardRef(() => AComponent), 

In a child component.

Changing places where I place forwardRef in the component hierarchy doesn't seem to have an effect on this error.

I don't have any related error in the console when running npm start though.

2
  • please provide more details, are you able to reproduce the error on stackblitz? a working example would be great Commented Apr 10 at 10:36
  • 1
    Forward ref is NOT to resolve circular dependencies.... Commented Apr 13 at 15:29

1 Answer 1

3

It could be a problem with WebStorm checking the error.

Try updating Angular and AngularJS plugin plugin of Webstorm if that is possible or even the editor version.

Webstorm Angular


Confirm forwardRef works through the application:

If your components AComponent, BComponent, CComponent are rendering properly.

You should check the exact route, where you get the error Uncaught (in promise): TypeError: Cannot read property 'ɵcmp' of undefined in angular with and without the forwardRef to confirm the forwardRef is working.

Then you can ignore this warning.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.