wallabyjs / console-ninja

Repository for Console Ninja questions and issues
https://console-ninja.com
Other
385 stars 22 forks source link

[Bug]: Ninja Console not Triggered in Windows 11 Command Prompt #317

Closed GregorBiswanger closed 4 months ago

GregorBiswanger commented 4 months ago

What happened?

Description: I am using Visual Studio Code and working with Angular. When I run the ng serve command in the integrated terminal of VS Code, the Ninja Console works as expected. However, when I run ng serve in the Windows 11 Command Prompt (outside of VS Code), the Ninja Console is not triggered automatically.

Expected Behavior: The Ninja Console should be triggered automatically regardless of the terminal being used (VS Code integrated terminal or Windows 11 Command Prompt) when the ng serve command is executed.

Suggested Solution: It would be helpful if the Ninja Console could be configured to trigger automatically regardless of the terminal being used. One possible solution could be to use environment variables or hooks that are recognized in any terminal.

Thank you in advance for your support!

Version

1.0.329

CLI command to start your dev tool

ng serve

Steps to reproduce (or sample repo)

Open Visual Studio Code. Run ng serve in the integrated terminal of VS Code. --> Ninja Console works correctly. Open the Windows 11 Command Prompt. Run ng serve in the Command Prompt. --> Ninja Console is not triggered.

Log output

-
smcenlly commented 4 months ago

Console Ninja functionality is provided via its VS Code extension, and so VS Code must be running before you attempt to start from the command-line.

If you open your project in VS Code before using the Windows 11 command prompt, then Console Ninja should work for you. If this doesn't work for you, there may be relevant details captured in your Console Ninja trace.log file. If you're still having problems, please:

  1. Delete your ~/.console-ninja/trace.log file in your user home directory.
  2. Open your project in VS Code.
  3. Start your application from the VS Code integrated terminal.
  4. Use console.log and confirm a the value is displayed in your editor.
  5. Stop your application in the VS Code integrated terminal.
  6. Start your application from an extern Windows 11 Command Prompt.
  7. Stop your application in the VS Code integrated terminal.
  8. Copy and paste your log output from the ~/.console-ninja/trace.log file in your user home directory.
GregorBiswanger commented 4 months ago

Hi @smcenlly, thanks for your answer. Nothing work by me. Integrated and outside "ng serve" from VS Code.

Here is my log:

09:51:13.899 info extension stopping host
09:51:14.338 info host ------------ starting ------------
09:51:14.447 info extension host process output: port:[57320]
09:51:14.447 info extension 
09:51:14.516 info host client connected: extension { address: '127.0.0.1', family: 'IPv4', port: 57320 }
09:51:14.548 info host worker Starting Host Worker...
09:51:14.932 info host starting host: {"extensionFolder":"c:\\Users\\gregor\\.vscode\\extensions\\wallabyjs.console-ninja-1.0.329","runtimeHookFile":"c:\\Users\\gregor\\.vscode\\extensions\\wallabyjs.console-ninja-1.0.329\\out\\runtimeHook\\tracer.js","globalErrorHandlerFile":"c:\\Users\\gregor\\.vscode\\extensions\\wallabyjs.console-ninja-1.0.329\\out\\runtimeHook\\errorHandler.js","networkLoggingHandlerFile":"c:\\Users\\gregor\\.vscode\\extensions\\wallabyjs.console-ninja-1.0.329\\out\\runtimeHook\\networkLoggingHandler.js","filesToInstrument":[{"path":"c:\\projects\\workshops\\angular\\mytodoapp\\src\\main.ts","reason":"search"},{"path":"c:\\projects\\workshops\\angular\\MyTodoApp\\src\\app\\todo-list\\auto-input-width.directive.ts","reason":"open"}],"debug":false,"config":{"dateTimeFormat":"HH:mm:ss.SSS","dateTimeDisplayMode":"Absolute","installBinToPath":true,"openLinksInEditor":true,"maxLogViewerEntries":15000,"showWelcomeMessageInTools":true,"fontSize":10,"outputMode":"Beside File","captureFunctions":false,"searchUrl":"https://www.google.com/search?q={query}","enableProFeatures":true,"toolsToAutoPatch":["vite","angular","jest","webpack","next.js","nest.js","cypress","http-server","serve","live-server","nuxt","remix","qwik","hydrogen","serverless","astro","live-server-extension"],"showErrors":true,"showLogsOnlyFromOpenedFiles":false,"showLogsFromLogPointsOnly":false,"showLogsFromMultipleRunningToolsTogether":false,"predictiveLoggingEnabled":true,"allowConsoleLogToTriggerPredictions":true,"showNetworkRequests":true},"allowedHosts":["localhost","127.0.0.1","example.cypress.io","ano-nym","192.168.233.60","172.20.240.1"],"host":"127.0.0.1","forcedStart":false,"startTime":1721116273904}
09:51:14.952 info host starting tools discovery and integration
09:51:14.960 info host looking for tools to patch
09:51:16.124 info host found 62 tool file(s) to patch
09:51:16.126 info host patching c:\Users\gregor\.vscode\extensions\ritwickdey.liveserver-5.7.9\node_modules\live-server\index.js
09:51:16.169 info host patching c:\projects\workshops\angular\mytodoapp\node_modules\.pnpm\node_modules\webpack\lib\index.js
09:51:16.169 info host patching c:\projects\workshops\angular\mytodoapp\node_modules\.pnpm\node_modules\webpack\lib\webpack.js
09:51:16.170 info host patching c:\projects\workshops\angular\mytodoapp\node_modules\.pnpm\node_modules\webpack\lib\WebpackOptionsApply.js
09:51:16.170 info host patching c:\projects\workshops\angular\mytodoapp\node_modules\.pnpm\webpack@5.92.1_esbuild@0.21.5\node_modules\webpack\lib\index.js
09:51:16.170 info host patching c:\projects\workshops\angular\mytodoapp\node_modules\.pnpm\webpack@5.92.1_esbuild@0.21.5\node_modules\webpack\lib\webpack.js
09:51:16.170 info host patching c:\projects\workshops\angular\mytodoapp\node_modules\.pnpm\webpack@5.92.1_esbuild@0.21.5\node_modules\webpack\lib\WebpackOptionsApply.js
09:51:16.175 info host patching c:\projects\workshops\angular\mytodoapp\node_modules\.pnpm\node_modules\vite\bin\vite.js
09:51:16.175 info host patching c:\projects\workshops\angular\mytodoapp\node_modules\.pnpm\vite@5.3.2_@types+node@20.14.10_less@4.2.0_sass@1.77.6_terser@5.29.2\node_modules\vite\bin\vite.js
09:51:16.177 info host patching c:\projects\workshops\angular\mytodoapp\node_modules\@angular\cli\bin\ng.js
09:51:16.177 info host patching c:\projects\workshops\angular\mytodoapp\node_modules\.pnpm\@angular+cli@18.1.0_chokidar@3.6.0\node_modules\@angular\cli\bin\ng.js
09:51:16.180 info host Host's startup and patch time: 2276 ms
09:51:16.180 info host completed tools discovery and integration
09:51:16.186 ERR! host uncaught exception: No clients connected
NikGovorov commented 4 months ago

Thanks for reporting the issue. In version v1.0.330 of the extension, we've added support for Angular CLI 18.

GregorBiswanger commented 4 months ago

I got now an exception after the update to v1.0.330 in the terminal:

> ng s
| Building...
Application bundle generation failed. [0.347 seconds]

X [ERROR] Angular compilation initialization failed. [plugin angular-compiler]

  Error: No handler function exported from C:\projects\workshops\angular\MyTodoApp\node_modules\.pnpm\@angular+build@18.1.0_@angular+compiler-cli@18.1.0_@angular+compiler@18.1.0_@angular+core@18._octxc6klx2245lpnmzofh2gxly\node_modules\@angular\build\src\tools\angular\compilation\parallel-worker.js
      at C:\projects\workshops\angular\MyTodoApp\node_modules\.pnpm\piscina@4.6.1\node_modules\piscina\dist\worker.js:144:23

Watch mode enabled. Watching for file changes...

Trace Log:

12:34:12.135 info extension stopping host
12:34:12.640 info host ------------ starting ------------
12:34:12.811 info extension host process output: port:[57320]
12:34:12.812 info extension 
12:34:12.870 info host worker Starting Host Worker...
12:34:12.904 info host client connected: extension { address: '127.0.0.1', family: 'IPv4', port: 57320 }
12:34:13.513 info host starting host: {"extensionFolder":"c:\\Users\\gregor\\.vscode\\extensions\\wallabyjs.console-ninja-1.0.330","runtimeHookFile":"c:\\Users\\gregor\\.vscode\\extensions\\wallabyjs.console-ninja-1.0.330\\out\\runtimeHook\\tracer.js","globalErrorHandlerFile":"c:\\Users\\gregor\\.vscode\\extensions\\wallabyjs.console-ninja-1.0.330\\out\\runtimeHook\\errorHandler.js","networkLoggingHandlerFile":"c:\\Users\\gregor\\.vscode\\extensions\\wallabyjs.console-ninja-1.0.330\\out\\runtimeHook\\networkLoggingHandler.js","filesToInstrument":[{"path":"c:\\projects\\workshops\\angular\\mytodoapp\\src\\main.ts","reason":"search"},{"path":"c:\\projects\\workshops\\angular\\MyTodoApp\\src\\app\\todo-list\\todo-list.component.html","reason":"open"},{"path":"c:\\projects\\workshops\\angular\\MyTodoApp\\src\\app\\todo-list\\list-box\\list-box.component.html","reason":"open"},{"path":"c:\\projects\\workshops\\angular\\MyTodoApp\\src\\app\\todo-list\\list-box\\list-box.component.ts","reason":"open"}],"debug":false,"config":{"dateTimeFormat":"HH:mm:ss.SSS","dateTimeDisplayMode":"Absolute","installBinToPath":true,"openLinksInEditor":true,"maxLogViewerEntries":15000,"showWelcomeMessageInTools":true,"fontSize":10,"outputMode":"Beside File","captureFunctions":false,"searchUrl":"https://www.google.com/search?q={query}","enableProFeatures":true,"toolsToAutoPatch":["vite","angular","jest","webpack","next.js","nest.js","cypress","http-server","serve","live-server","nuxt","remix","qwik","hydrogen","serverless","astro","live-server-extension"],"showErrors":true,"showLogsOnlyFromOpenedFiles":false,"showLogsFromLogPointsOnly":false,"showLogsFromMultipleRunningToolsTogether":false,"predictiveLoggingEnabled":true,"allowConsoleLogToTriggerPredictions":true,"showNetworkRequests":true},"allowedHosts":["localhost","127.0.0.1","example.cypress.io","ano-nym","192.168.233.60","172.20.240.1"],"host":"127.0.0.1","forcedStart":false,"startTime":1721126052153}
12:34:13.547 info host starting tools discovery and integration
12:34:13.572 info host looking for tools to patch
12:34:14.659 info host found 68 tool file(s) to patch
12:34:14.661 info host patching c:\Users\gregor\.vscode\extensions\ritwickdey.liveserver-5.7.9\node_modules\live-server\index.js
12:34:14.710 info host patching c:\projects\workshops\angular\mytodoapp\node_modules\.pnpm\node_modules\webpack\lib\index.js
12:34:14.711 info host patching c:\projects\workshops\angular\mytodoapp\node_modules\.pnpm\node_modules\webpack\lib\webpack.js
12:34:14.711 info host patching c:\projects\workshops\angular\mytodoapp\node_modules\.pnpm\node_modules\webpack\lib\WebpackOptionsApply.js
12:34:14.711 info host patching c:\projects\workshops\angular\mytodoapp\node_modules\.pnpm\webpack@5.92.1_esbuild@0.21.5\node_modules\webpack\lib\index.js
12:34:14.712 info host patching c:\projects\workshops\angular\mytodoapp\node_modules\.pnpm\webpack@5.92.1_esbuild@0.21.5\node_modules\webpack\lib\webpack.js
12:34:14.712 info host patching c:\projects\workshops\angular\mytodoapp\node_modules\.pnpm\webpack@5.92.1_esbuild@0.21.5\node_modules\webpack\lib\WebpackOptionsApply.js
12:34:14.718 info host patching c:\projects\workshops\angular\mytodoapp\node_modules\.pnpm\node_modules\vite\bin\vite.js
12:34:14.718 info host patching c:\projects\workshops\angular\mytodoapp\node_modules\.pnpm\vite@5.3.2_@types+node@20.14.10_less@4.2.0_sass@1.77.6_terser@5.29.2\node_modules\vite\bin\vite.js
12:34:14.727 info host patching c:\projects\workshops\angular\mytodoapp\node_modules\@angular\cli\bin\ng.js
12:34:14.727 info host patching c:\projects\workshops\angular\mytodoapp\node_modules\.pnpm\@angular+cli@18.1.0_chokidar@3.6.0\node_modules\@angular\cli\bin\ng.js
12:34:14.727 info host patching c:\projects\workshops\angular\mytodoapp\node_modules\.pnpm\node_modules\@angular\build\src\tools\esbuild\javascript-transformer-worker.js
12:34:14.728 info host patching c:\projects\workshops\angular\mytodoapp\node_modules\.pnpm\@angular+build@18.1.0_@angular+compiler-cli@18.1.0_@angular+compiler@18.1.0_@angular+core@18._octxc6klx2245lpnmzofh2gxly\node_modules\@angular\build\src\tools\esbuild\javascript-transformer-worker.js
12:34:14.728 info host patching c:\projects\workshops\angular\mytodoapp\node_modules\.pnpm\node_modules\@angular\build\src\tools\angular\compilation\parallel-worker.js
12:34:14.728 info host patching c:\projects\workshops\angular\mytodoapp\node_modules\.pnpm\@angular+build@18.1.0_@angular+compiler-cli@18.1.0_@angular+compiler@18.1.0_@angular+core@18._octxc6klx2245lpnmzofh2gxly\node_modules\@angular\build\src\tools\angular\compilation\parallel-worker.js
12:34:14.844 info host Host's startup and patch time: 2691 ms
12:34:14.844 info host completed tools discovery and integration
12:34:14.853 ERR! host uncaught exception: No clients connected
12:34:23.883 info buildHook-40920 installing build hook for angular at c:\projects\workshops\angular\mytodoapp, node v20.13.1
12:34:23.893 info buildHook-40920 allowed tools: vite, angular, jest, webpack, next.js, nest.js, cypress, http-server, serve, live-server, nuxt, remix, qwik, hydrogen, serverless, astro, live-server-extension, node
12:34:23.893 info buildHook-40920 running tools: angular
12:34:23.896 info buildHook-40920 installing fs interceptor
12:34:23.905 info host client connected: buildHook { address: '127.0.0.1', family: 'IPv4', port: 57320 }
12:34:26.417 info host client disconnected: buildHook 1006
12:34:26.417 info host client disconnected: buildHook 1006, has clients false
12:34:33.327 info buildHook-19920 installing build hook for angular at c:\projects\workshops\angular\mytodoapp, node v20.13.1
12:34:33.336 info buildHook-19920 allowed tools: vite, angular, jest, webpack, next.js, nest.js, cypress, http-server, serve, live-server, nuxt, remix, qwik, hydrogen, serverless, astro, live-server-extension, node
12:34:33.336 info buildHook-19920 running tools: angular
12:34:33.339 info buildHook-19920 installing fs interceptor
12:34:33.348 info host client connected: buildHook { address: '127.0.0.1', family: 'IPv4', port: 57320 }
NikGovorov commented 4 months ago

Could you please attach C:\projects\workshops\angular\MyTodoApp\node_modules\.pnpm\@angular+build@18.1.0_@angular+compiler-cli@18.1.0_@angular+compiler@18.1.0_@angular+core@18._octxc6klx2245lpnmzofh2gxly\node_modules\@angular\build\src\tools\angular\compilation\parallel-worker.js file?

GregorBiswanger commented 4 months ago

parallel-worker.txt rename it to js

NikGovorov commented 4 months ago

Could you please try to delete c:\projects\workshops\angular\mytodoapp\node_modules\.pnpm\@angular+build@18.1.0_@angular+compiler-cli@18.1.0_@angular+compiler@18.1.0_@angular+core@18._octxc6klx2245lpnmzofh2gxly folder, reinstall the modules pnpm install in the project, restart VS Code and run ng serve?

GregorBiswanger commented 4 months ago

I deleted the node_modules and after reinstalling the packages, it worked again...

If I start "ng service" integrated first and then stop it again and use the command prompt outside, it also works outside of VSCode.. Thank you very much... I love your work..