wallabyjs / console-ninja

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

Not detecting next.js start #33

Closed alex-statsig closed 1 year ago

alex-statsig commented 1 year ago

Extension is stuck on "Console Ninja is ⌛ waiting for next.js to start. Console Ninja has successfully integrated with next.js found in your project dependencies, but has not connected to a running instance of it yet.", even after starting via "pnpm dev".

These are the logs:

info host ------------ starting ------------
info extension host process output: port:[65437]
info host worker Starting Host Worker...
info extension 
info host client connected: extension { address: '::', family: 'IPv6', port: 65437 }
info host starting host: {"extensionFolder":"/Users/alex/.vscode-insiders/extensions/wallabyjs.console-ninja-0.0.24","runtimeHookFile":"/Users/alex/.vscode-insiders/extensions/wallabyjs.console-ninja-0.0.24/out/runtimeHook/tracer.js","globalErrorHandlerFile":"/Users/alex/.vscode-insiders/extensions/wallabyjs.console-ninja-0.0.24/out/runtimeHook/errorHandler.js","filesToInstrument":["(...long list of files)"],"debug":false,"config":{"dateTimeFormat":"hh:mm:ss.SSS","openLinksInEditor":true,"maxLogViewerEntries":15000,"autoClearLogViewerOnFileChanges":true,"outputMode":"Beside File","toolsToAutoPatch":["next.js","http-server"]}}
info host starting tools discovery and integration
info host looking for tools to patch
info host found 10 tool file(s) to patch
info host patching /Users/alex/dev/statsig/node_modules/next/dist/compiled/webpack/bundle5.js
info host patching /Users/alex/dev/statsig/console/node_modules/next/dist/compiled/webpack/bundle5.js
info host patching /Users/alex/dev/statsig/intern/node_modules/next/dist/compiled/webpack/bundle5.js
info host patching /Users/alex/dev/statsig/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js
info host patching /Users/alex/dev/statsig/console/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js
info host patching /Users/alex/dev/statsig/intern/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js
info host patching /Users/alex/dev/statsig/node_modules/.pnpm/next@12.3.0_hoopuhfcxzwq3qcfqmjjrgp5yu/node_modules/next/dist/compiled/webpack/bundle5.js
info host patching /Users/alex/dev/statsig/node_modules/.pnpm/next@12.3.0_u5oxe5ddziuyvtw2sb5xyxdf6a/node_modules/next/dist/compiled/webpack/bundle5.js
info host patching /Users/alex/dev/statsig/node_modules/.pnpm/next@12.3.0_hoopuhfcxzwq3qcfqmjjrgp5yu/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js
info host patching /Users/alex/dev/statsig/node_modules/.pnpm/next@12.3.0_u5oxe5ddziuyvtw2sb5xyxdf6a/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js
info host completed tools discovery and integration
info buildHook-96350 installing build hook for next.js at /Users/alex/dev/statsig/console

The project I'm working on is located at statsig/console, which seems to have been patched based on the logs.

gitgregoryfuntera commented 1 year ago

Same as well on my end it got stuck on the 'Starting Host Worker' I had tried the following:

See below logs:

info extension stopping host
info extension client disconnected: 1006 
info extension host process output: port:[61254]
info host ------------ starting ------------
info extension 
info host client connected: extension { address: '::', family: 'IPv6', port: 61254 }
info host worker Starting Host Worker...
info host starting host: {"extensionFolder":"c:\\Users\\Greg\\.vscode\\extensions\\wallabyjs.console-ninja-0.0.24","runtimeHookFile":"c:\\Users\\Greg\\.vscode\\extensions\\wallabyjs.console-ninja-0.0.24\\out\\runtimeHook\\tracer.js","globalErrorHandlerFile":"c:\\Users\\Greg\\.vscode\\extensions\\wallabyjs.console-ninja-0.0.24\\out\\runtimeHook\\errorHandler.js","filesToInstrument":["C:\\Users\\Greg\\Documents\\Web Development\\Workspace\\REACT\\Udemy_NextJS\\section-13\\components\\starting-page\\starting-page.js","C:\\Users\\Greg\\Documents\\Web Development\\Workspace\\REACT\\Udemy_NextJS\\section-13\\components\\auth\\auth-form.js","c:\\Users\\Greg\\Documents\\Web Development\\Workspace\\REACT\\Udemy_NextJS\\section-13\\components\\starting-page\\starting-page.js"],"debug":false,"config":{"dateTimeFormat":"hh:mm:ss.SSS","openLinksInEditor":true,"maxLogViewerEntries":15000,"autoClearLogViewerOnFileChanges":false,"outputMode":"Beside File","toolsToAutoPatch":["vite","jest","webpack","next.js","cypress","http-server","serve","hydrogen"]}}
info host starting tools discovery and integration
info host looking for tools to patch
info host found 1 tool file(s) to patch
info host patching C:\Users\Greg\Documents\Web Development\Workspace\REACT\Udemy_NextJS\section-13\node_modules\next\dist\compiled\webpack\bundle5.js
info host completed tools discovery and integration
info extension stopping host
info extension client disconnected: 1006 
info extension host process output: port:[61265]
info host ------------ starting ------------
info extension 
info host client connected: extension { address: '::', family: 'IPv6', port: 61265 }
info host worker Starting Host Worker...
alex-statsig commented 1 year ago

Updated issue (after trying to pause/resume and restart the extension). I'm getting "SyntaxError: Invalid or unexpected token" after trying to start my server, here's the stack:

SyntaxError: Invalid or unexpected token
    at Object.compileFunction (node:vm:352:18)
    at wrapSafe (node:internal/modules/cjs/loader:1033:15)
    at Module._compile (node:internal/modules/cjs/loader:1069:27)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.exports.init (/Users/alex/dev/statsig/node_modules/.pnpm/next@12.3.0_hoopuhfcxzwq3qcfqmjjrgp5yu/node_modules/next/dist/compiled/webpack/webpack.js:24:28)
    at Object.loadWebpackHook (/Users/alex/dev/statsig/node_modules/.pnpm/next@12.3.0_hoopuhfcxzwq3qcfqmjjrgp5yu/node_modules/next/dist/server/config-utils.js:13:19)
info host ------------ starting ------------
info extension host process output: port:[53928]
info extension 
info host worker Starting Host Worker...
info host client connected: extension { address: '::', family: 'IPv6', port: 53928 }
info host starting host: {"extensionFolder":"/Users/alex/.vscode-insiders/extensions/wallabyjs.console-ninja-0.0.24","runtimeHookFile":"/Users/alex/.vscode-insiders/extensions/wallabyjs.console-ninja-0.0.24/out/runtimeHook/tracer.js","globalErrorHandlerFile":"/Users/alex/.vscode-insiders/extensions/wallabyjs.console-ninja-0.0.24/out/runtimeHook/errorHandler.js","filesToInstrument":["(a bunch of files)"],"debug":false,"config":{"dateTimeFormat":"hh:mm:ss.SSS","openLinksInEditor":true,"maxLogViewerEntries":15000,"autoClearLogViewerOnFileChanges":true,"outputMode":"Beside File","toolsToAutoPatch":["next.js","http-server"]}}
info host starting tools discovery and integration
info host looking for tools to patch
info host found 10 tool file(s) to patch
info host patching /Users/alex/dev/statsig/node_modules/next/dist/compiled/webpack/bundle5.js
info host patching /Users/alex/dev/statsig/intern/node_modules/next/dist/compiled/webpack/bundle5.js
info host patching /Users/alex/dev/statsig/console/node_modules/next/dist/compiled/webpack/bundle5.js
info host patching /Users/alex/dev/statsig/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js
info host patching /Users/alex/dev/statsig/intern/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js
info host patching /Users/alex/dev/statsig/console/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js
info host patching /Users/alex/dev/statsig/node_modules/.pnpm/next@12.3.0_hoopuhfcxzwq3qcfqmjjrgp5yu/node_modules/next/dist/compiled/webpack/bundle5.js
info host patching /Users/alex/dev/statsig/node_modules/.pnpm/next@12.3.0_u5oxe5ddziuyvtw2sb5xyxdf6a/node_modules/next/dist/compiled/webpack/bundle5.js
info host patching /Users/alex/dev/statsig/node_modules/.pnpm/next@12.3.0_hoopuhfcxzwq3qcfqmjjrgp5yu/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js
info host patching /Users/alex/dev/statsig/node_modules/.pnpm/next@12.3.0_u5oxe5ddziuyvtw2sb5xyxdf6a/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js
info host completed tools discovery and integration
ArtemGovorov commented 1 year ago

@alex-statsig Can you please share the content of the /Users/alex/dev/statsig/node_modules/.pnpm/next@12.3.0_hoopuhfcxzwq3qcfqmjjrgp5yu/node_modules/next/dist/compiled/webpack/webpack.js file?

ArtemGovorov commented 1 year ago

@gitgregoryfuntera This looks like a different issue, mind creating a separate one for it and specify your OS version/node.js version/VS Code version?

alex-statsig commented 1 year ago

Can you please share the content of the /Users/alex/dev/statsig/node_modules/.pnpm/next@12.3.0_hoopuhfcxzwq3qcfqmjjrgp5yu/node_modules/next/dist/compiled/webpack/webpack.js file?

exports.__esModule = true

exports.default = undefined

exports.init = function () {
  if (process.env.NEXT_PRIVATE_LOCAL_webpack) {
    Object.assign(exports, {
      // eslint-disable-next-line import/no-extraneous-dependencies
      BasicEvaluatedExpression: require('webpack/lib/javascript/BasicEvaluatedExpression'),
      // eslint-disable-next-line import/no-extraneous-dependencies
      ModuleFilenameHelpers: require('webpack/lib/ModuleFilenameHelpers'),
      // eslint-disable-next-line import/no-extraneous-dependencies
      NodeTargetPlugin: require('webpack/lib/node/NodeTargetPlugin'),
      // eslint-disable-next-line import/no-extraneous-dependencies
      StringXor: require('webpack/lib/util/StringXor'),
      // eslint-disable-next-line import/no-extraneous-dependencies
      NormalModule: require('webpack/lib/NormalModule'),
      // eslint-disable-next-line import/no-extraneous-dependencies
      sources: require('webpack').sources,
      // eslint-disable-next-line import/no-extraneous-dependencies
      webpack: require('webpack'),
    })
  } else {
    Object.assign(exports, require('./bundle5')())
  }
}
gitgregoryfuntera commented 1 year ago

@gitgregoryfuntera This looks like a different issue, mind creating a separate one for it and specify your OS version/node.js version/VS Code version?

All good @ArtemGovorov it seems to be working now on my end. I just need to restart my machine not quite sure what happened there. image But if you still info for my machine/node version/vscode version please see below:

OS - windows 11
node version - 16.13.1
vscode version: 1.74.0

Thank you

ArtemGovorov commented 1 year ago

@alex-statsig Can you please try updating the extension to the latest version (0.0.29+), and restarting your next.js CLI to see if it fixes anything?

alex-statsig commented 1 year ago

@alex-statsig Can you please try updating the extension to the latest version (0.0.29+), and restarting your next.js CLI to see if it fixes anything?

Looks resolved now, thanks!