question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Does clinic.js works with Nextjs?

See original GitHub issue

Expected Behavior

I have a project that is in Nextjs and Typescript. As we really need SEO, SSR is a must. However the project seems to be really slow and we are trying to dig in what is the root causes of the issue and I just found out about Clinic.js which seems to be a good tool for this.

When running the command: $ clinic doctor -- node dist/server/index.js I would expected to get the report from Clinicjs.

Current Behavior

Running the command: $ clinic doctor -- node dist/server/index.js ends with this result always:

`[=== ] Analysing dataundefined:1
[{"pid":94325,"tid":775,"ts":610333271714,"tts":142032,"ph":"E","cat":"v8","name":"V8.Execute","dur":0,"tExecute","dur":0,"tdur":0,"args":{"runtime-call-stats":{}}},{"pid":94326,"tid":775,"ts":610333454873,"tts":153118,"ph":"B","cat":"v8","name":"V8.Execute","dur":0,"tdur":0,"args":{}},{"pid":94326,"tid":775,"ts":610333454890,"tts":153135,"ph":"E","cat":"v8","name":"V8.Execute","dur":0,"tdur":0,"args":{"runtime-call-stats":{}}},{"pid":94326,"tid":775,"ts":610333467923,"tts":153165,"ph":"B","cat":"v8","name":"V8.Execute","dur":0,"tdur":0,"args":{}},{"pid":94326,"tid":775,"ts":610333468204,"tts":153446,"ph":"E","cat":"v8","name":"V8.Execute","dur":0,"tdur":0,"args":{"runtime-call-stats":{}}},{"pid":94326,"tid":775,"ts":610333468213,"tts":153454,"ph":"B","cat":"v8","name":"V8.Execute","dur":0,"tdur":0,"args":{}},{"pid":94326,"tid":775,"ts":610333468246,"tts":153488,"ph":"E","cat":"v8","name":"V8.Execute","dur":0,"tdur":0,"args":{"runtime-call-stats":{}}},{"pid":94326,"tid":775,"ts":610333468402,"tt

SyntaxError: Unexpected token , in JSON at position 113
    at JSON.parse (<anonymous>)
    at Parser._transform (/Users/user/.config/yarn/global/node_modules/@nearform/trace-events-parser/index.js:41:34)
    at Parser.Transform._read (_stream_transform.js:191:10)
    at Parser.Transform._write (_stream_transform.js:179:12)
    at doWrite (_stream_writable.js:441:12)
    at writeOrBuffer (_stream_writable.js:425:5)
    at Parser.Writable.write (_stream_writable.js:316:11)
    at TraceEventDecoder._transform (/Users/user/.config/yarn/global/node_modules/@nearform/doctor/format/trace-event-decoder.js:60:19)
    at TraceEventDecoder.Transform._read (_stream_transform.js:191:10)
    at TraceEventDecoder.Transform._write (_stream_transform.js:179:12)`

Environment

  • Clinic.js version: v5.0.3
  • Node.js version: v12.16.1 npm v6.13.4
  • Operating system and version: MacOS Darwin local 19.5.0 Darwin Kernel Version 19.5.0.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:7
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
filloncommented, Jun 9, 2021

Hi @afbarbaro

After making the change in next-dev-server.js, how do you run clinic ?

`clinic doctor --on-port --autocannon [ -c 2 -d 5 / ] – node ./node_modules/.bin/next dev ???

1reaction
DylanCcommented, Sep 9, 2020

@guimochila - Yes, that is correct! Child processes are not supported yet.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation - Clinic.js
Clinic.js is a suite of tools to help diagnose and pinpoint your Node.js performance issues.
Read more >
How to implement clinic.js in Nest JS Framework (typescript)
js in Nest JS Framework. I explore it how to implement clinic.js to Nest JS. But I couldn't get any answer can you...
Read more >
How to Build a Hospital Record App with NextJs & Strapi
In this article, we will learn how to make use of Strapi while building a hospital records application with Next.JS.
Read more >
@clinic/bubbleprof: Documentation | Openbase
clinic /bubbleprof docs, getting started, code examples, API reference and more. ... The filepath relative to the current working directory will be the...
Read more >
FAQ - Next.js
Can I make a Next.js Progressive Web App (PWA)?.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found