Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I use clinic.js with nuxt? #455

Open
sjahns opened this issue Jul 13, 2023 · 8 comments
Open

How do I use clinic.js with nuxt? #455

sjahns opened this issue Jul 13, 2023 · 8 comments

Comments

@sjahns
Copy link

sjahns commented Jul 13, 2023

I want to use clinic js for a nuxt application but have so far been unable to get it to work. I am at a loss at what the command has to look like. From what I have seen I need to give clinic a js file to execute.

I prepare a build with npm run build and then how do I continue? The only way I got something other than an error was
clinic doctor -- node .nuxt/dist/server/server.js
but that gives an empty analysis. How do I tell clinic js to analyse the page that I would find under "localhost:3000/jobs" for example?
I tried things like
clinic doctor --on-port 'wrk http://localhost:$PORT/jobs' -- node .nuxt/dist/server/server.js'
clinic doctor --autocannon [ -m GET 'http://localhost:$PORT/jobs' ] -- node .nuxt/dist/server/server.js

But again I am not even sure if that is the correct file.

Thanks.

Environment

  • Clinic.js version:v13.0.0
  • Doctor version: v11.0.0
  • nuxt version: 2.16.*
  • Node.js version: v16.20.1
  • npm version: 9.8.0
@RafaelGSS
Copy link
Contributor

I tried things like
clinic doctor --on-port 'wrk http://localhost:$PORT/jobs' -- node .nuxt/dist/server/server.js'
clinic doctor --autocannon [ -m GET 'http://localhost:$PORT/jobs' ] -- node .nuxt/dist/server/server.js

That's correct, but you need to consider this will evaluate the server.js operations in the backend. This won't give you information about scripts evaluated in the front-end side.

@sjahns
Copy link
Author

sjahns commented Jul 14, 2023

Yes I am aware, but those commands give me empty results.
Profile data collected seems to be empty, report may not be generated
Also it runs so quickly that i am sure it doesn't do anything.

@RafaelGSS
Copy link
Contributor

Try changing it to:

$ clinic doctor --autocannon [ -d 30 -c 100 /jobs ] -- node .nuxt/dist/server/server.js

@sjahns
Copy link
Author

sjahns commented Jul 24, 2023

Sorry for the delay, was busy the last week.

I get the same empty result with that command.

@RafaelGSS
Copy link
Contributor

can you create a minimal reproducible code?

@ly95
Copy link

ly95 commented Aug 4, 2023

same issue, after ctrl+c got error

Error: process exited by signal SIGABRT
    at ChildProcess.<anonymous> (/Users/xxx/.nvm/versions/node/v18.14.0/lib/node_modules/clinic/node_modules/@clinic/doctor/index.js:139:13)
    at Object.onceWrapper (node:events:628:26)
    at ChildProcess.emit (node:events:513:28)
    at ChildProcess._handle.onexit (node:internal/child_process:291:12)

@sjahns
Copy link
Author

sjahns commented Aug 16, 2023

Sorry for the delay

https://github.com/sjahns/clinic-test

I just created an empty nuxt project and tried to use clinic doctor. Same result, as in empty result.

This is Nuxt 2.17 though.

@AminAzGol
Copy link

AminAzGol commented Jan 13, 2024

same issue, after ctrl+c got error

Error: process exited by signal SIGABRT
    at ChildProcess.<anonymous> (/Users/xxx/.nvm/versions/node/v18.14.0/lib/node_modules/clinic/node_modules/@clinic/doctor/index.js:139:13)
    at Object.onceWrapper (node:events:628:26)
    at ChildProcess.emit (node:events:513:28)
    at ChildProcess._handle.onexit (node:internal/child_process:291:12)

I'm having this issue by running any app with clinic doctor. tried it with NestJs and NodeJs. Even I get it while running the official sample.

sudo clinic doctor --on-port 'autocannon localhost:$PORT' -- node slow-event-loop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants