Cannot open JS file in LWC component
When LWC component contains a few JS file, I cannot open JS file that name differs from LWC component - IntelliJ is opening meta-xml file instead. E.g. When I have LWC component named myComponent and this component contains below files:
- myComponent.html
- myComponent.js
- myComponentHelper.js
- myComponent .js-meta.xml
Then I cannot open myComponentHelper.js file. I’m redirected to myComponent .js-meta.xml
Comments (6)
-
repo owner -
reporter @Scott Wells After I reinstalled IntelliJ - the issue disappeared. Thanks for your support.
-
reporter - changed status to resolved
-
repo owner Glad to hear. Thanks for letting me know it's resolved for you. Out of curiosity, were you on an older version of IC2 before reinstalling? I'm just trying to determine whether there was an issue with the latest version, albeit resolved by reinstall, or if it was due to being on an older version where this problem did in fact exist.
-
reporter I was working on IntelliJ v.2022.1.3, and Illuminated Cloud v.2.2.2.7. Now I’m using IntelliJ v.2022.1.4 and the same version on IC. To be honest I don’t know why reinstalling the IDE resolved the issue, because my software was up-to-date. Maybe there was an issue in the IntelliJ core? Fortunately, this issue doesn't occur now.
-
repo owner Okay, thanks for letting me know. I wouldn't expect that minor version difference to factor in. Definitely let me know if you see such behavior again.
- Log in to comment
Hi. I apologize but I'm unable to reproduce this behavior:
I did the following in my attempt to reproduce:
lwc
directory, and clicked New > Lightning Web Component and entered a component name ofmyComponent
. That of course createdmyComponent
(directory),myComponent/myComponent.html
,myComponent/myComponent.js
, andmyComponent/myComponent.js-meta.xml
.myComponent
directory and then clicked New > Lightning Web Component JavaScript File. I entered a class name of MyComponentHelper which createdmyComponent/myComponentHelper.js
. Note that I also verified that this works properly when I instead use New > JavaScript File and enter a filename ofmyComponentHelper.js
.myComponent/myComponentHelper.js
in the project view. The view shown in the screenshot above was displayed.I guess as a first check, can you confirm that you're on the latest build of IC2? If not, please update and see if the same issue is still present. If so, are these the same steps you followed? If not, what are your steps to reproduce? Also, can you please attach your project's
.iml
file for review and specify the project root-relative path to themyComponent
bundle directory so I can confirm that it's under a configured source root?