Just upgraded from 2.4 to 3.3 and Angular stoped being recognized

So I have a Spring project with one module being the angular frontend with it's node modules inside. Using Intellij IDEA I never got all autocompletions to work in there (actually I was having exactly the same I'm having now after updating the WebStorm version).

Last week I tried opening only the frontend module with WebStorm I installed a few months ago and, to my surprise, voilá, everything was working fine!

Today I got a notification that I could update, did so and when got everything up and running again, to my sad surprise I was left with same behaviour as Intellij Idea.

I've tried unexcluding stuff from node_modules and adding them to Java Script Libraries without any success. Any other clues on what to do?




That's what I'm currently seeing. Stuff inside not recognised tags also doesn't get recognised in the TS files:


As said, I tried excluding/including @angular and primeng several times without much success.


25 comments
Comment actions Permalink

what does your frontend project structure look like? Do you have node_modules installed in WebStorm project root, or in a subfolder? Also, can you attach a screenshot of the Project tool window with node_modules/@angular folder expanded so that I can see what it looks like?

Also, please select your .html file in Project tool window, hit `Ctrl+Q` (or whatever shortcut is assigned to View | Quick Documentation main menu action) and attach a screenshot of the popup that opens

0
Comment actions Permalink

That's my project structure:



Node modules expanded (PrimeNg is down there, the list goes forever)



Ctrl+Q in the html file:

0
Comment actions Permalink

I also need the stuff inside @eUI since those ux- come from there


0
Comment actions Permalink

there is nothing unusual with the structure, as far as I can see (except for explicitly un-exluded modules - you don't normally need doing this: direct dependencies must have already been added to libraries and thus included). But files are recognized as pure HTML and not angular templates... Can you check if removing .idea folder from the project root dir and re-opening the project in webstorm via File | Open solves the issue? If it doesn't, could you provide your idea.log?

0
Comment actions Permalink

I already deleted the .idea folder several times with not much success. Did it again now and still the same. I tried re-installing WebStorm. Didn't work either.

How can I provide you my idea.log?

0
Comment actions Permalink

please upload it to some file server and provide a link

0
Comment actions Permalink

In case it helps, now this is my Libraries folder after deleting .idea again (It seems it's not adding angular out of the box there?):



Btw, much thanks for the help!

0
Comment actions Permalink

>It seems it's not adding angular out of the box there?

it should be added as a part of sacs-frontend-eui/node_modules library.

Your log shows no errors, AngularJS plugin is compatible and enabled... Weird

Can you recreate the issue with a new Angular CLI project created with File > New > Project?

0
Comment actions Permalink

This project is located inside an other, I know it shouldn't be inlfuenced since I understand everything is stored in its own .idea folder, but notting it here just in case.

I'm creating the Angular Cli project...

0
Comment actions Permalink

So, that's what I get with Ctrl+Q in the app.component.html in the new project:

0
Comment actions Permalink

And just in case that helps I expanded a bit more the structure:

My Project <---------> New Project

0
Comment actions Permalink

So, everything looks good with a new project... It's something specific to your frontend app then...

Can you share your frontend project? You can remove all your proprietary .ts/html files from src folder, just leave the configuration stuff - angular.json, package.json, etc.

0
Comment actions Permalink

Mmmh, sharing everything may prove difficult since node_modules size but I can surelly zip the files at package.json level and share them.

An other thing I noticed: When WebStorm promted me with installing dependencies (even though they where already installed), it went through the process of installing them and then the code wouldn't compile when running the server because some Cannot redeclare block-scoped variable 'ngDevMode' related to PrimeNg so I had to delete primeng from node_modules and use regular npm install from the console. This same thing happened with the old version of WebStorm but there I got angular properly detected so I don't think it's related.

Here you have the files:

https://drive.google.com/open?id=10drCM7LuA1I4_Rjl93L_2ixhM26VLDu7

0
Comment actions Permalink

Thanks! You don't have `@angular/core` listed as a dependency in your package.json... Is this module included in your node_modules (may be, as @eui/core dependency)? This module should be installed and included in index to make angular support work..

0
Comment actions Permalink

Yeah, @eui has a core folder, do you want to take a look at the package.json there?

0
Comment actions Permalink

That's inside so yeah, the dependency is expressed there:

"dependencies": {
"@angular/animations": "5.2.11",
"@angular/cdk": "5.2.5",
"@angular/common": "5.2.11",
"@angular/compiler": "5.2.11",
"@angular/compiler-cli": "5.2.11",
"@angular/core": "5.2.11",


So, that means you know how to solve it? :)

0
Comment actions Permalink

Please expand the node_modules/@angular folder in the Project tool window - can you see core package there? pleadse attach screenshot

0
Comment actions Permalink

Please try adding "@angular/core" as a dependency to your package.json (no need to run npm install) and re-open the project - does it make any difference?

0
Comment actions Permalink

Yeah, not even needed to re-open the project. Is there a way of doing that without adding the dependency there?

0
Comment actions Permalink

un-excluding node_modules/@angular/core explicitly may also help, but I'm not sure:(

0
Comment actions Permalink

Nope, that didn't work, which was expectable since previously I had un-excluded the whole @angular and several other ones :S

Any other clue?

Weirdest thing is that it was working in a previous version and I saw other posts with people complaining about the same when upgrading so maybe they are facing the same issue. In that case that's something the dev team should be aware of and be fixed...

0
Comment actions Permalink

Indeed, seems to be a regression; please follow https://youtrack.jetbrains.com/issue/WEB-36722 for updates

 

> I saw other posts with people complaining about the same when upgrading so maybe they are facing the same issue.

 

They were mostly facing a different issue, https://youtrack.jetbrains.com/issue/WEB-36065, but it's fixed in 3.3

0
Comment actions Permalink

Ok! Following that issue.

Once again, much thanks for the help!

0

Please sign in to leave a comment.