Skip to content

[JetBrains 1.59.0] Generate UI silently fails: IllegalArgumentException in Notifier.notifyNoGenerators when generatorAllowlist filters out all generators #3128

Description

@vladlen-volkov

Summary

In WebStorm, clicking Nx Generate (UI) does absolutely nothing — no popup, no error, no toast. The user has no way of knowing why. Tracing through plugin source revealed two bugs:

  1. Cover-up bug: Notifier.notifyNoGenerators calls addAction(ActionManager.getInstance().getAction("OpenLog")). In WebStorm 2025.3 the action ID "OpenLog" does not resolve, so getAction returns null. Notification.addAction is @NotNull, so it throws IllegalArgumentException. The "No generators found" notification never appears, hiding the real problem from the user.
  2. Trigger bug (root cause for me): an obsolete entry in .idea/nx-console.xml had a generatorAllowlist matching nothing in the workspace, so getFilteredGenerators() filtered every real generator out, producing an empty list. There is no UI affordance I could find to inspect or clear that allowlist after it gets set.

The two combined produce a perfectly silent failure on a healthy workspace.

Environment

  • Nx Console version: 1.59.0
  • IDE: WebStorm 2025.3.2, Build #WS-253.30387.83
  • JDK: 21.0.9 (JetBrains)
  • OS: macOS 15 (Darwin 25.4.0)
  • Node: 24.12.0 (via nvm)
  • Package manager: pnpm
  • Nx: 22.6.2

Symptom

  • nx/generators LSP request returns successfully with a full list (@angular/cdk:drag-drop, @nx/angular:component, etc. — verified in idea.log).
  • Daemon is healthy, workspace is healthy, nx/cloudStatus.isConnected=false (Nx Cloud disconnected and disabled).
  • Click "Generate (UI)" → nothing happens. No popup. No notification. No editor message.
  • Repeated clicks produce repeated identical stack traces in idea.log, but no user-visible feedback.

Stack trace (from idea.log)

SEVERE - #c.i.o.a.i.ExceptionsKt - Unhandled exception in
[Kernel@..., ..., CoroutineName(dev.nx.console.generate.NxGenerateService), Dispatchers.Default],
interactive mode: false
java.lang.IllegalArgumentException: Argument for @NotNull parameter 'action'
of com/intellij/notification/Notification.addAction must not be null
    at com.intellij.notification.Notification.$$$reportNull$$$0(Notification.java)
    at com.intellij.notification.Notification.addAction(Notification.java)
    at dev.nx.console.utils.Notifier$Companion.notifyNoGenerators(Notifier.kt:176)
    at dev.nx.console.generate.NxGenerateService$selectGenerator$2$1.invokeSuspend(NxGenerateService.kt:73)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
    ...
SEVERE - Plugin to blame: Nx Console version: 1.59.0
SEVERE - Last Action: dev.nx.console.generate.actions.NxGenerateUiAction

Root cause analysis

Bug 1 — Notifier.kt:176

In apps/intellij/src/main/kotlin/dev/nx/console/utils/Notifier.kt:

} else {
    notification.addAction(ActionManager.getInstance().getAction("OpenLog"))
}

ActionManager.getAction("OpenLog") returns null in WebStorm 2025.3 (the action ID is not registered there — it exists in IntelliJ IDEA but not in every JetBrains IDE). Notification.addAction(@NotNull AnAction) then throws.

Suggested fix: null-check the result, or guard with a find-by-id and fall back to no action / a different action that exists across all JetBrains IDEs (e.g., ShowLog or simply skip the action button when the ID is unresolved).

} else {
    val openLog = ActionManager.getInstance().getAction("OpenLog")
    if (openLog != null) notification.addAction(openLog)
}

Bug 2 — empty getFilteredGenerators() with no UX path to recover

In apps/intellij/src/main/kotlin/dev/nx/console/generate/NxGenerateService.kt, getFilteredGenerators() reads NxConsoleProjectSettingsProvider.getInstance(project).generatorFilters (mapped to generatorAllowlist in the persisted XML).

In my project, .idea/nx-console.xml contained:

<component name="NxConsoleProjectSettingsProvider">
  <option name="generatorAllowlist">
    <map>
      <entry key="@nx/example:*" value="true" />
    </map>
  </option>
</component>

I do not remember setting this and there's no @nx/example plugin in the workspace. The matcher uses matchWithWildcards, so @nx/example:* matches no real generator — every actual generator gets filtered out, and selectGenerator() calls notifyNoGenerators(...) (which then crashes per Bug 1).

The result is doubly silent: the user has no idea that (a) a filter is being applied, (b) the filter excludes everything, or (c) the resulting "no generators" notification crashed before rendering.

Suggested fixes:

  1. Surface the active allowlist somewhere visible (settings panel, status bar tooltip, or in the empty-state notification text — "0 of N generators matched filter @nx/example:*").
  2. Validate the allowlist against the actual generator list when settings are saved, and warn if no entry would match anything.
  3. Provide a UI to clear/edit the allowlist (I could not find one in the Nx Console settings page).

Reproduction

  1. Open any Nx 22 workspace in WebStorm 2025.3 with Nx Console 1.59.0.
  2. Add to .idea/nx-console.xml:
    <component name="NxConsoleProjectSettingsProvider">
      <option name="generatorAllowlist">
        <map>
          <entry key="@nx/nonexistent:*" value="true" />
        </map>
      </option>
    </component>
  3. Reload the project.
  4. Click any Nx Generate (UI) entry point (toolbar, context menu, Find Action).
  5. Observe: nothing visible happens. Open idea.log to see the IllegalArgumentException from Notifier.notifyNoGenerators.

Workaround that fixed it for me

Edit .idea/nx-console.xml to remove the allowlist:

<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="NxConsoleProjectSettingsProvider" />
</project>

Then reload from disk in WebStorm. Generate UI works immediately — popup appears with the full list of @angular/cdk:*, @nx/angular:*, etc. No plugin reinstall, no daemon reset, no IDE restart needed.

Related issues

A common thread is: when getFilteredGenerators returns empty, the user gets no actionable feedback in WebStorm. Fixing Bug 1 alone would already turn the silent failure of #2753-class issues into a visible "No generators found" notification, which would have made my own diagnosis trivial.

Asks

  1. Patch Notifier.notifyNoGenerators (Bug 1) — small, low-risk null-guard.
  2. Add UX for inspecting/clearing the generator allowlist (Bug 2) — or at least include the active filter pattern in the empty-state message.

Happy to PR Bug 1 if useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions