nrwl / nx-console

Nx Console is the user interface for Nx & Lerna.
https://nx.dev
MIT License
1.3k stars 212 forks source link

Nx Console Generate (UI) tab displaying raw HTML instead of generator options UI in Webstorm #2160

Open jschwarty opened 4 weeks ago

jschwarty commented 4 weeks ago

Current Behavior

When selecting a Generator from the Generate (UI) panel the Generate tab opens up and just displays the following HTML:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Generate UI</title>
  <link href="output.css" rel="stylesheet">
</head>
<body class="intellij-scrollbar">
<script src="api.js"></script>

<script src="main.js" type="module"></script>
<root-element></root-element>
</body>
</html>
Screenshot 2024-06-07 at 7 36 45 AM

Expected Behavior

The Generate tab should display the UI for the Generator schema options.

Steps to Reproduce

Install any version of Webstorm. Install the Nx Console plugin. Open an Nx project and try to use the Generate (UI).

Failure Logs / Images / Videos

Unhandled exception in [ComponentManager(ProjectImpl@2120388552), CoroutineName(dev.nx.console.generate.ui.file.V2NxGenerateUiFileCoroutineHolder), StandaloneCoroutine{Cancelling}@78ba2b25, Dispatchers.Default]

com.intellij.ui.jcef.JBCefBrowserJsCallError: Failed to execute JavaScript expression in JCEF browser. TypeError: Cannot read properties of undefined (reading 'registerPostToIdeCallback')
    at com.intellij.ui.jcef.JBCefBrowserJsCall$createErrorHandlerQueryWithinScope$2$1.invoke(JBCefBrowserJsCall.kt:231)
    at com.intellij.ui.jcef.JBCefBrowserJsCall$createErrorHandlerQueryWithinScope$2$1.invoke(JBCefBrowserJsCall.kt:229)
    at com.intellij.ui.jcef.JBCefBrowserJsCall.createErrorHandlerQueryWithinScope$lambda$12$lambda$11(JBCefBrowserJsCall.kt:229)
    at com.intellij.ui.jcef.JBCefJSQuery$1.onQuery(JBCefJSQuery.java:123)
    Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [ComponentManager(ProjectImpl@2120388552), CoroutineName(dev.nx.console.generate.ui.file.V2NxGenerateUiFileCoroutineHolder), StandaloneCoroutine{Cancelled}@78ba2b25, Dispatchers.Default]

Environment

jschwarty commented 4 weeks ago

Hey @MaxKless 👋

It's super weird. Some devs on the same setup above do not see this issue, but I do. I have tried a complete fresh install (default settings) of Webstorm with no additional plugins but Nx Console and I still see this issue.

MaxKless commented 4 weeks ago

Weird... I've only seen this once before, here: https://github.com/nrwl/nx-console/issues/1971

Maybe you can read through this and poke around in your environment a little bit more. I couldn't reproduce on the first try on my machine but I'll try again first thing monday :)

MaxKless commented 3 weeks ago

Hey @jschwarty! Just checking in on whether you've had the chance to look at the other issue. Something else that would be super useful for me: If you could provide some logs from one machine where the error happens and one where the error doesn't happen in the same workspace. That way I can compare the logs and see if anything stands out.

Go to Help > Diagnostic Tools > Debug Log Settings... and then insert #dev.nx.console:trace. Then paste the idea.log or sections of it when the error happens.

Thank you!