Angular tags not recognised in Angular project with Storybook in 2023.3.3 or 2024.1 EAP
Hi!
I'm encountering an issue in WebStorm where Angular tags are no longer recognized. It could be due to a configuration change, but I'm unable to identify the specific alteration responsible for this sudden occurrence.
It's worth noting that all TypeScript files are in order, and there are no reported issues with them. However, the problem extends to HTML tags related to Angular components, including standard tags such as <ng-content> and <ng-container>, as well as custom components like <app-my-component> and components from the library <my-lib-my-component>.
The error message received is: "Unknown html tag app-my-component."
I've attempted several solutions found online and in this forum, including:
- Removing the exclusion of the node_modules folder.
- Deleting the .idea folder and restarting.
- Temporarily disabling all plugins, with subsequent re-enabling of the Angular plugin alone.
- Upgrading WebStorm to the latest version (2024).
- Invalidating caches and restarting the system.
I've also reviewed a related forum post [https://intellij-support.jetbrains.com/hc/en-us/community/posts/14691959710610-Unknown-html-tag-div-in-PHPStorm-2023-2-3], but unfortunately, it didn't provide a solution.
Despite these efforts, the issue persists. It feels very frustrating that the basic functionality I need from WebStorm is not working. I hope there is a solution!
Thanks in advance!
Please sign in to leave a comment.
Hello!
please could you share your project
package.json
?I am experiencing a similar problem in a hybrid Angular/Angular JS project, also since 2023.3.3. Only the components that have the same selector in Angular JS are recognized in HTML templates, but they should actually refer to the Angular ones in that context.
The project
package.json
would be helpful.Just found out the Angular JS components are detected because of the @ngdoc comments we have in those.
I can't just share the whole package.json, but these are the versions of Angular related packages we use.
Do you have any other frameworks (
react
,vue
, etc) listed in your dependencies? They can cause problems recognizing Angular templates.Storybook added a
react
dependency with the latest version. Moving these to thedevDependencies
fixed it, thanks!Thanks for clearing it up! Please follow WEB-65265 for updates.
Hi, thanks for all the reactions,
I can confirm that the error is related to the react dependency being included. Moving it to the devDependencies worked! Thanks 🥳!
For future reference: here is my package.json
I encountered the same issue in my Angular project using nx and Storybook, which has been in place for several months. The problem emerged today without any npm install or update being performed. Moving react & react-dom to devDependencies resolved it. I noticed this issue in both IntelliJ Ultimate and WebStorm.
moving react to devDeps won't affect the production build?
This is still all kinds of broken with an Angular Storybook project. Even with devDependencies. Invalidate caches, and Repair IDE do not work either. This worked perfectly before 2023.3.3, this happened once a while back in a previous upgrade as well and we had to add some directory in settings I remember. Not only does it break angular components it breaks all components made with angular as well. Its hard to ignore to because it also triggers all the built in Problems and Analysis error and warnings too.
does seem to be fixed/handled in `WebStorm 2024.1 EAP Build #WS-241.11761.28, built on February 8, 2024`
I have a nx project.
Almost everything is Angular, but I have an internal documentation in Docusaurus (React)
Moving react & react-dom to devDependencies fixed for me
Thank you so much :)
Moving react & react-dom to devDependencies fixed for me as well.
I am working in a Nx Standalone Angular Application.
Thank you all!
Two days lost trying to find, why IntelliJ suddently stopped recognizing my Angular tags. I do use Storybook and I did have react and react-dom in dependencies - moving them to devDependencies fixed all. Thanks you so much!!!