WarningImHack3r / npm-update-dependencies

Update NPM dependencies from your IDE
https://plugins.jetbrains.com/plugin/21105-npm-update-dependencies
9 stars 2 forks source link

Outdated packages are not highlighted anymore #109

Closed nutzaalex closed 3 months ago

nutzaalex commented 3 months ago

What is the issue?

In the past, i used to see a warning underline under outdated packages in package.json in webstorm. This is no longer the case, I now see only vulnerabilities.

What are the steps to reproduce this issue?

It seems to simply happen in webstorm, I reverted to factory settings thinking I may have some other settings that are interfering, but I cannot get it to highlight outdated packages anymore. need to hover the mouse over each one to check if there is an update.

What were you expecting to happen?

As before, a warning underline highlighting the outdated packages.

Paste any relevant logs, error output, etc.

No response

What OS are you experiencing the problem on?

macOS

Additional platform information

WebStorm 2024.1.3 Build #WS-241.17011.90, built on May 23, 2024

Macbook pro M2 pro chip macos sonoma 14.5

Duplicates

WarningImHack3r commented 3 months ago

Hey there! Do you still can upgrade dependencies by hovering on them and/or batch updating through the plugin’s menu? Do you see the progress and scan report in the status bar? And if so, when clicking the status bar item do you see a list of outdated dependencies?

nutzaalex commented 3 months ago

I can upgrade dep by hovering on them and using update all from the menu. I don't see the progress and scan report in the status bar though.

Screenshot 2024-06-07 at 09 57 53
nutzaalex commented 3 months ago

here are the available options from the dropdown in case this helps:

Screenshot 2024-06-07 at 10 03 05

I invalidated cache both from this menu and a couple of times while reverting webstorm to factory settings, but it didnt fix it.

WarningImHack3r commented 3 months ago

It looks like a hovering color issue in the IDE. I’m using the default warning and error colors the IDE provides. Can you check in the settings that both are enabled and configured? You can easily know if it’s not by introducing a warning-level problem in your code and see if this is properly highlighted too. If code warnings are not highlighted in the code too, it’s an IDE configuration issue.

Also, do you see the warnings/errors icons on the top right corner of the opened package.json file?

As for the status bar, is it enabled in the plugin settings? Didn’t you hide it from the WebStorm UI? (You can right click any status bar item and check if my plugin name is ticked or not)

nutzaalex commented 3 months ago

hmmm, so I do see warnings if a package has a security vulnerability:

Screenshot 2024-06-07 at 10 21 12 Screenshot 2024-06-07 at 10 21 24
WarningImHack3r commented 3 months ago

That’s from the IDE, however it’s doesn’t seem to be the same kind of warning than the one I use (I use a regular warning, this one seems to be a security warning, which doesn’t have the same color afaik) Can you try a warning in your code for example?

nutzaalex commented 3 months ago

Hmm, I have looked in all editor inspections and color scheme, I think I do have warning colors set, and I do see them, even weak ones 🤔:

Screenshot 2024-06-07 at 10 40 48 Screenshot 2024-06-07 at 10 42 41

I'll check some more, do you have the exact warning name? I can perhaps search for that in the settings

WarningImHack3r commented 3 months ago

For deprecations, I’m using an highlight severity of Error with an highlight type of Like_Deprecated

For updates, I’m using an highlight severity and an highlight type of both Warning

WarningImHack3r commented 3 months ago

Also, did your overall issue happened after an upgrade of WS/my plugin or randomly after a WS restart?

nutzaalex commented 3 months ago

It has been happening for a few days, I just started doing some updates recently and immediately noticed that feature was missing. Then I reset settings, reinstalled the plugin, reset cache etc. to try and make it work again.

nutzaalex commented 3 months ago

I think you may be right, warnings are not shown in all cases even though I have them enabled. I will write to jetbrains about this.

nutzaalex commented 3 months ago

Discussed with intelij support, the errors and warnings seem to be working fine, as before, the plugin does not highlight oudated packages in package.json.

Here's proof of my inspections working, err, warning, weak warning, all of them in different colors:

Screenshot 2024-06-07 at 13 01 59
WarningImHack3r commented 3 months ago

I'll try once I'm home to reproduce your issue and indicate precisely which setting does affect the highlighting color for updates, even though it seems to be working fine in your setup.

I don't manage that from the plugin, the color highlighting is made by the IDE from the parameters I tell it to use so I doubt I can do anything about your issue, though I'll try my best to give you the best diagnostic I can.

nutzaalex commented 3 months ago

No worries take your time.

On another note, the plugin it just crashed, heres the trace:

ExternalToolPass: 

com.intellij.diagnostic.PluginException: annotator: com.github.warningimhack3r.npmupdatedependencies.ui.annotation.UpdatesAnnotator@6ca7d3b7 (class com.github.warningimhack3r.npmupdatedependencies.ui.annotation.UpdatesAnnotator) [Plugin: com.github.warningimhack3r.npmupdatedependencies]
    at com.intellij.diagnostic.PluginProblemReporterImpl.createPluginExceptionByClass(PluginProblemReporterImpl.java:23)
    at com.intellij.diagnostic.PluginException.createByClass(PluginException.java:90)
    at com.intellij.codeInsight.daemon.impl.ExternalToolPass.processError(ExternalToolPass.java:253)
    at com.intellij.codeInsight.daemon.impl.ExternalToolPass.doAnnotate(ExternalToolPass.java:213)
    at com.intellij.codeInsight.daemon.impl.ExternalToolPass.doAnnotate(ExternalToolPass.java:200)
    at com.intellij.codeInsight.daemon.impl.ExternalToolPass$1.lambda$run$0(ExternalToolPass.java:163)
    at com.intellij.codeInsight.daemon.impl.ExternalToolPass.runChangeAware(ExternalToolPass.java:268)
    at com.intellij.codeInsight.daemon.impl.ExternalToolPass$1.lambda$run$2(ExternalToolPass.java:163)
    at com.intellij.openapi.progress.util.BackgroundTaskUtil.lambda$runUnderDisposeAwareIndicator$15(BackgroundTaskUtil.java:371)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:217)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:660)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:735)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:691)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:659)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:79)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:202)
    at com.intellij.openapi.progress.util.BackgroundTaskUtil.runUnderDisposeAwareIndicator(BackgroundTaskUtil.java:366)
    at com.intellij.codeInsight.daemon.impl.ExternalToolPass$1.run(ExternalToolPass.java:161)
    at com.intellij.util.ui.update.ContextAwareUpdate.run$lambda$1$lambda$0(ContextAwareUpdate.kt:49)
    at com.intellij.util.concurrency.ChildContext$runAsCoroutine$1.invoke(propagation.kt:81)
    at com.intellij.util.concurrency.ChildContext$runAsCoroutine$1.invoke(propagation.kt:81)
    at com.intellij.util.concurrency.ChildContext.runAsCoroutine(propagation.kt:86)
    at com.intellij.util.concurrency.ChildContext.runAsCoroutine(propagation.kt:81)
    at com.intellij.util.ui.update.ContextAwareUpdate.run(ContextAwareUpdate.kt:48)
    at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:354)
    at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:344)
    at com.intellij.util.ui.update.MergingUpdateQueue.doFlush(MergingUpdateQueue.java:301)
    at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:283)
    at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:250)
    at com.intellij.util.concurrency.ChildContext$runAsCoroutine$1.invoke(propagation.kt:81)
    at com.intellij.util.concurrency.ChildContext$runAsCoroutine$1.invoke(propagation.kt:81)
    at com.intellij.util.concurrency.ChildContext.runAsCoroutine(propagation.kt:86)
    at com.intellij.util.concurrency.ChildContext.runAsCoroutine(propagation.kt:81)
    at com.intellij.util.Alarm$Request.lambda$runSafely$0(Alarm.java:369)
    at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:253)
    at com.intellij.util.Alarm$Request.runSafely(Alarm.java:369)
    at com.intellij.util.Alarm$Request.run(Alarm.java:356)
    at com.intellij.util.concurrency.Propagation.contextAwareCallable$lambda$2(propagation.kt:357)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask.run(SchedulingWrapper.java:272)
    at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:244)
    at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:30)
    at com.intellij.util.concurrency.BoundedTaskExecutor$1.executeFirstTaskAndHelpQueue(BoundedTaskExecutor.java:222)
    at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:218)
    at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:210)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
    at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
    at org.semver4j.internal.Comparator.checkAlphanumericPrerelease(Comparator.java:109)
    at org.semver4j.internal.Comparator.compareIdentifiers(Comparator.java:89)
    at org.semver4j.internal.Comparator.preReleaseCompare(Comparator.java:73)
    at org.semver4j.internal.Comparator.compareTo(Comparator.java:26)
    at org.semver4j.Semver.compareTo(Semver.java:355)
    at org.semver4j.Semver.compareTo(Semver.java:21)
    at kotlin.comparisons.ReverseOrderComparator.compare(Comparisons.kt:324)
    at kotlin.comparisons.ReverseOrderComparator.compare(Comparisons.kt:323)
    at java.base/java.util.TimSort.binarySort(TimSort.java:296)
    at java.base/java.util.TimSort.sort(TimSort.java:239)
    at java.base/java.util.Arrays.sort(Arrays.java:1233)
    at kotlin.collections.ArraysKt___ArraysJvmKt.sortWith(_ArraysJvm.kt:2179)
    at kotlin.collections.CollectionsKt___CollectionsKt.sortedWith(_Collections.kt:1075)
    at kotlin.collections.CollectionsKt___CollectionsKt.sortedDescending(_Collections.kt:1063)
    at com.github.warningimhack3r.npmupdatedependencies.backend.engine.PackageUpdateChecker.areUpdatesAvailable(PackageUpdateChecker.kt:111)
    at com.github.warningimhack3r.npmupdatedependencies.ui.annotation.UpdatesAnnotator$doAnnotate$2.invokeSuspend(UpdatesAnnotator.kt:80)
    at com.github.warningimhack3r.npmupdatedependencies.ui.annotation.UpdatesAnnotator$doAnnotate$2.invoke(UpdatesAnnotator.kt)
    at com.github.warningimhack3r.npmupdatedependencies.ui.annotation.UpdatesAnnotator$doAnnotate$2.invoke(UpdatesAnnotator.kt)
    at com.github.warningimhack3r.npmupdatedependencies.backend.extensions.ExtensionsKt$parallelMap$1$1$1$1.invokeSuspend(Extensions.kt:29)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
WarningImHack3r commented 3 months ago

Looks like a bug in the Semver lib I use: can you send me your package.json so I can run it, identify which dep + version is causing that so I can fill an issue on their hand?

nutzaalex commented 3 months ago

hmm, unfortunately I can't share it all it as its a private repo, but I disabled sections of it. Surprisingly, a popular one is the issue, commenting this it makes the plugin work again:

"styled-components": "5.3.8",

WarningImHack3r commented 3 months ago

Alright I'm gonna try to reproduce that with this line and send the report, thanks!

nutzaalex commented 3 months ago

thanks for taking the time to find the issue! have an easy weekend!

WarningImHack3r commented 3 months ago

Your highlighting issue is not solved! ^^

The parsing crash is just another thing

nutzaalex commented 3 months ago

oh, but it is :D that library is the issue the highlighting is not being applied:

Screenshot 2024-06-07 at 17 48 37

its just that it doesn't crash often at all, only sometime, but as you can see, it works without that lib + ver

WarningImHack3r commented 3 months ago

Oh!!! But how on earth were some deps highlighted hoverable despite that issue... It should've hang/crash before the end of the scan

Anyway, glad we found the cause: reporting that when I get home :)

WarningImHack3r commented 3 months ago

@nutzaalex FYI: https://github.com/semver4j/semver4j/issues/264 (NPM packages must really stop creating such Semver monstrosities)