console-ninja icon indicating copy to clipboard operation
console-ninja copied to clipboard

[Bug]: Console Ninja is waiting for runtime events. Console ninja does not display inline logging next to my console logs.

Open KBaldwin2 opened this issue 1 year ago • 6 comments

What happened?

When running my next.js application console ninja is turned on and displays the message "Console Ninja is waiting for runtime events. Console Ninja has started with next.js and is now waiting for some runtime logs or errors." But does not display results from any log in my project. When running the app I can see the logs in the console so I know the event is being triggered.

image

image image

Version

v1.0.297

Steps to reproduce (or sample repo)

  1. Install Console Ninja
  2. Run next.js project

Log output

07:49:25.047 info extension stopping host
07:49:25.863 info host ------------ starting ------------
07:49:25.923 info extension host process output: port:[59401]
07:49:25.924 info extension 
07:49:26.009 info host client connected: extension { address: '127.0.0.1', family: 'IPv4', port: 59401 }
07:49:26.531 info host worker Starting Host Worker...
07:49:27.642 info host starting host: {"extensionFolder":"c:\\Users\\kbaldwin\\.vscode\\extensions\\wallabyjs.console-ninja-1.0.297","runtimeHookFile":"c:\\Users\\kbaldwin\\.vscode\\extensions\\wallabyjs.console-ninja-1.0.297\\out\\runtimeHook\\tracer.js","globalErrorHandlerFile":"c:\\Users\\kbaldwin\\.vscode\\extensions\\wallabyjs.console-ninja-1.0.297\\out\\runtimeHook\\errorHandler.js","filesToInstrument":[{"path":"c:\\users\\kbaldwin\\desktop\\goodtoshow\\src\\app\\api\\webhooks\\stripe\\price-record.ts","reason":"search"},{"path":"c:\\users\\kbaldwin\\desktop\\goodtoshow\\src\\app\\api\\webhooks\\stripe\\route.ts","reason":"search"},{"path":"c:\\users\\kbaldwin\\desktop\\goodtoshow\\src\\app\\api\\webhooks\\sms\\listing-code\\route.ts","reason":"search"},{"path":"c:\\users\\kbaldwin\\desktop\\goodtoshow\\src\\app\\api\\webhooks\\sms\\conditionally-sold-expired\\route.ts","reason":"search"},{"path":"c:\\users\\kbaldwin\\desktop\\goodtoshow\\src\\app\\api\\webhooks\\sms\\confirm-showing\\route.ts","reason":"search"},{"path":"c:\\users\\kbaldwin\\desktop\\goodtoshow\\src\\app\\(dashboard)\\error.tsx","reason":"search"},{"path":"c:\\users\\kbaldwin\\desktop\\goodtoshow\\src\\app\\api\\trpc\\[trpc]\\route.ts","reason":"search"},{"path":"c:\\users\\kbaldwin\\desktop\\goodtoshow\\src\\app\\(dashboard)\\listings\\listings-view.scene.tsx","reason":"search"},{"path":"c:\\users\\kbaldwin\\desktop\\goodtoshow\\src\\app\\(dashboard)\\listings\\create\\components\\listing-form.tsx","reason":"search"},{"path":"c:\\Users\\kbaldwin\\Desktop\\goodtoshow\\src\\app\\(dashboard)\\listings\\listings-view.scene.tsx","reason":"open"},{"path":"c:\\Users\\kbaldwin\\Desktop\\goodtoshow\\.eslintrc.cjs","reason":"open"}],"debug":false,"config":{"dateTimeFormat":"HH:mm:ss.SSS","dateTimeDisplayMode":"Absolute","installBinToPath":true,"openLinksInEditor":true,"maxLogViewerEntries":15000,"fontSize":10,"outputMode":"Beside File","captureFunctions":false,"searchUrl":"https://www.google.com/search?q={query}","enableProFeatures":false,"toolsToAutoPatch":["vite","angular","jest","webpack","next.js","nest.js","cypress","http-server","serve","live-server","remix","qwik","hydrogen","serverless","live-server-extension"],"showErrors":true,"showLogsOnlyFromOpenedFiles":false,"showLogsFromLogPointsOnly":false,"showLogsFromMultipleRunningToolsTogether":false,"predictiveLoggingEnabled":true,"allowConsoleLogToTriggerPredictions":false},"allowedHosts":["localhost","127.0.0.1","example.cypress.io","KB-XPS15","192.168.99.6","10.0.0.119","172.26.80.1"],"host":"127.0.0.1","forcedStart":true,"startTime":1712324965052}
07:49:27.663 info host starting tools discovery and integration
07:49:27.699 info host looking for tools to patch
07:49:28.073 info host found 3 tool file(s) to patch
07:49:28.074 info host patching c:\Users\kbaldwin\.vscode\extensions\ritwickdey.liveserver-5.7.9\node_modules\live-server\index.js
07:49:28.077 info host patching c:\users\kbaldwin\desktop\goodtoshow\node_modules\next\dist\compiled\webpack\bundle5.js
07:49:28.077 info host patching c:\users\kbaldwin\desktop\goodtoshow\node_modules\next\dist\build\webpack\loaders\next-swc-loader.js
07:49:28.188 info host Host's startup and patch time: 3136 ms
07:49:28.189 info host completed tools discovery and integration
07:51:29.088 info host client connected: buildHook { address: '127.0.0.1', family: 'IPv4', port: 59401 }
07:51:28.696 info buildHook-20436 installing build hook for next.js at c:\users\kbaldwin\desktop\goodtoshow, node v20.11.1
07:51:28.714 info buildHook-20436 allowed tools: vite, angular, jest, webpack, next.js, nest.js, cypress, http-server, serve, live-server, remix, qwik, hydrogen, serverless, live-server-extension, node
07:51:28.714 info buildHook-20436 running tools: next.js
07:51:28.887 info buildHook-20436 installing fs interceptor
07:51:29.133 info buildHook-20436 file processed (stat): 1 log points, error handler: false
07:51:29.154 info buildHook-20436 file processed (stat): 3 log points, error handler: false
07:51:29.166 info buildHook-20436 file processed (stat): 0 log points, error handler: false
07:51:29.188 info buildHook-20436 file processed (stat): 0 log points, error handler: false
07:51:29.193 info buildHook-20436 file processed (stat): 0 log points, error handler: false
07:51:29.204 info buildHook-20436 file processed (stat): 0 log points, error handler: false
07:51:29.210 info buildHook-20436 file processed (stat): 0 log points, error handler: false
07:51:29.237 info buildHook-20436 file processed (stat): 2 log points, error handler: false
07:51:29.279 info buildHook-20436 file processed (stat): 1 log points, error handler: false
07:51:29.289 info buildHook-20436 file processed (stat): 0 log points, error handler: false
07:51:29.289 info buildHook-20436 allowed tools: vite, angular, jest, webpack, next.js, nest.js, cypress, http-server, serve, live-server, remix, qwik, hydrogen, serverless, live-server-extension, node
07:51:29.289 info buildHook-20436 running tools: next.js
07:51:31.854 info host client connected: buildHook { address: '127.0.0.1', family: 'IPv4', port: 59401 }
07:51:31.764 info buildHook-10384 installing build hook for next.js at c:\users\kbaldwin\desktop\goodtoshow, node v20.11.1
07:51:31.777 info buildHook-10384 allowed tools: vite, angular, jest, webpack, next.js, nest.js, cypress, http-server, serve, live-server, remix, qwik, hydrogen, serverless, live-server-extension, node
07:51:31.777 info buildHook-10384 running tools: next.js
07:51:31.779 info buildHook-10384 installing fs interceptor
07:51:31.900 info buildHook-10384 file processed (stat): 1 log points, error handler: false
07:51:31.919 info buildHook-10384 file processed (stat): 3 log points, error handler: false
07:51:31.930 info buildHook-10384 file processed (stat): 0 log points, error handler: false
07:51:31.953 info buildHook-10384 file processed (stat): 0 log points, error handler: false
07:51:31.957 info buildHook-10384 file processed (stat): 0 log points, error handler: false
07:51:31.969 info buildHook-10384 file processed (stat): 0 log points, error handler: false
07:51:31.974 info buildHook-10384 file processed (stat): 0 log points, error handler: false
07:51:32.000 info buildHook-10384 file processed (stat): 2 log points, error handler: false
07:51:32.038 info buildHook-10384 file processed (stat): 1 log points, error handler: false
07:51:32.048 info buildHook-10384 file processed (stat): 0 log points, error handler: false
07:51:32.048 info buildHook-10384 allowed tools: vite, angular, jest, webpack, next.js, nest.js, cypress, http-server, serve, live-server, remix, qwik, hydrogen, serverless, live-server-extension, node
07:51:32.048 info buildHook-10384 running tools: next.js

KBaldwin2 avatar Apr 05 '24 14:04 KBaldwin2

We've made some changes to Console Ninja that we think may fix your problem.

Can you please update to Console Ninja v1.0.298 and let us know if it works for you?

smcenlly avatar Apr 08 '24 08:04 smcenlly

I updated it and it did not help. Still just says it is waiting for runtime events image

KBaldwin2 avatar Apr 17 '24 00:04 KBaldwin2

I am having the exact same issue FYI, and I'm on version 1.0.307 of console ninja.

mearleycf avatar Apr 17 '24 02:04 mearleycf

Are you running your dev script with the --turbo flag? The flag is not yet supported by Console Ninja.

smcenlly avatar Apr 17 '24 23:04 smcenlly

Have had this same issue since the last few weeks. The console ninja has stopped catching events. There are no logs or trace points for the console. I use a NestJS app running in PM2 together with a React UI running on Vite. Now, I don't see any logs from the backend or the UI.

Currently i'm downgrading to v1.0.290 what works fine

zalewskigrzegorz avatar Jul 08 '24 17:07 zalewskigrzegorz

@zalewskigrzegorz - you mentioned that you've had the problem for the last few weeks. The version you have downgraded to (v1.0.290) is many versions behind (from February).

Can you please try bisecting versions to help us identify the version where it stopped working for you? For example, you're on v290 and the latest is v328, try v309. If v309 works for you, then try half-way between v309 and v328, etc.

Also, if you're able, please provide a sample repo that has the same problem so we can attempt to reproduce the problem for ourselves.

smcenlly avatar Jul 08 '24 22:07 smcenlly

I am facing the same issue. CN is fine working only with the backend which is the node and express, But when it comes to the frontend which is react configured by vite, At the moment when starts the react CN is not working. Shows Console Ninja is waiting for runtime events.

CN version: v1.0.364

thomasantony12 avatar Oct 17 '24 03:10 thomasantony12

I am facing the same issue. CN is fine working only with the backend which is the node and express, But when it comes to the frontend which is react configured by vite, At the moment when starts the react CN is not working. Shows Console Ninja is waiting for runtime events.

CN version: v1.0.364

I tried several versions of CN, and now I think this problem is resolved when the version is v1.0.290.

The v1.0.291 also worked for one time but when I tried again the error again appeared.

thomasantony12 avatar Oct 17 '24 04:10 thomasantony12

@thomasantony12 - we'd like to be able to help you get this working on the latest version. Can you please do the following:

  1. Install the latest version of Console Ninja from the VS Code marketplace
  2. Delete your Console Ninja log file from the hidden folder in your home directory: ~/.console-ninja/trace.log
  3. Reproduce your problem
  4. Provide us with the contents of the log file (~/.console-ninja/trace.log)

smcenlly avatar Oct 17 '24 23:10 smcenlly

@thomasantony12 - we'd like to be able to help you get this working on the latest version. Can you please do the following:

  1. Install the latest version of Console Ninja from the VS Code marketplace
  2. Delete your Console Ninja log file from the hidden folder in your home directory: ~/.console-ninja/trace.log
  3. Reproduce your problem
  4. Provide us with the contents of the log file (~/.console-ninja/trace.log)

tracer.txt

thomasantony12 avatar Oct 18 '24 12:10 thomasantony12

Ran into the same issue in 1.0.364

gilliav avatar Oct 21 '24 09:10 gilliav

My problem is solved when I change my language mode from JSX to JavaScript. Try it out and let me know.

Screenshot (164)

Screenshot (165)

  • After changing the mode restart the CN and also in the terminal

Try this and let me know if this works for you.

thomasantony12 avatar Oct 22 '24 09:10 thomasantony12

@thomasantony12 - Console Ninja doesn't use the language mode at all (it only uses your files on disk). It's possible that your dev tools, or some other extension is interfering with Console Ninja operating without the Language Mode set correctly.

Are you able to provide us with a sample repo and a set of instructions for reproducing the not working vs. working behavior?

smcenlly avatar Oct 22 '24 23:10 smcenlly

@thomasantony12 - Console Ninja doesn't use the language mode at all (it only uses your files on disk). It's possible that your dev tools, or some other extension is interfering with Console Ninja operating without the Language Mode set correctly.

Are you able to provide us with a sample repo and a set of instructions for reproducing the not working vs. working behavior?

Somehow it worked for me; maybe it will work for others too. I have already shared the log file above, so you can examine what's wrong.

thomasantony12 avatar Oct 23 '24 01:10 thomasantony12

Hello. I am having this same issue using release 1.0.381. Thought it was a local directory issue, so I created the test app, but I still no longer see any console-ninja logging. Following these steps, I have provided the trace.log below:

  1. Install the latest version of Console Ninja from the VS Code marketplace
    
  2. Delete your Console Ninja log file from the hidden folder in your home directory: ~/.console-ninja/trace.log
    
  3. Reproduce your problem
    
  4. Provide us with the contents of the log file (~/.console-ninja/trace.log)
    

12:44:51.526 info buildHook-17201 installing build hook for next.js at /users/camar/desktop/code/test-app, node v20.10.0
12:44:51.529 info buildHook-17201 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, live-preview-extension, node
12:44:51.529 info buildHook-17201 running tools: next.js
12:44:51.530 info buildHook-17201 installing fs interceptor
12:44:51.550 info host client connected: buildHook { address: '127.0.0.1', family: 'IPv4', port: 54372 }
12:44:51.635 info buildHook-17201 file processed (stat): 3 log points, error handler: false, network logging handler: false
12:44:51.635 info buildHook-17201 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, live-preview-extension, node
12:44:51.635 info buildHook-17201 running tools: next.js
12:44:51.640 info buildHook-17201 file processed (stat): 4 log points, error handler: false, network logging handler: false
12:44:51.988 info buildHook-17202 installing build hook for next.js at /users/camar/desktop/code/test-app, node v20.10.0
12:44:51.991 info buildHook-17202 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, live-preview-extension, node
12:44:51.991 info buildHook-17202 running tools: next.js
12:44:51.992 info buildHook-17202 installing fs interceptor
12:44:52.011 info host client connected: buildHook { address: '127.0.0.1', family: 'IPv4', port: 54372 }
12:44:52.026 info buildHook-17202 file processed (stat): 3 log points, error handler: false, network logging handler: false
12:44:52.027 info buildHook-17202 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, live-preview-extension, node
12:44:52.027 info buildHook-17202 running tools: next.js
12:44:52.033 info buildHook-17202 file processed (stat): 4 log points, error handler: false, network logging handler: false
12:44:52.347 info buildHook-17202 file processed (stat): 0 log points, error handler: false, network logging handler: false
12:44:52.351 info buildHook-17202 file processed (stat): 3 log points, error handler: false, network logging handler: false

Image

DCamarco avatar Jan 17 '25 17:01 DCamarco

@DCamarco - based on your screenshot, it appears your Next.js instance is using Turbopack.

Console Ninja does not currently support Turbopack. You will need to update your next.js scripts/configuration to not use Turbopack (i.e. use Webpack instead).

smcenlly avatar Jan 17 '25 23:01 smcenlly

Closing this issue. Assuming our suggestion fixed your problem.

smcenlly avatar Jan 20 '25 22:01 smcenlly