Does it possible to run it with the babel-node?
I use babel-node for react jsx and some other stuff. Does it possible to run the clinic flame with the babel-node?
Using command:
BROWSERSLIST="> 0.8%, not IE 11" BABEL_DISABLE_CACHE=1 NODE_ENV=production BABEL_ENV=server clinic flame -- babel-node server/server.js
Receiving error:
project/web/clinic.js:13
if (err) throw err;
^
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
at assertPath (path.js:39:11)
at join (path.js:1152:7)
at v8.catch (project/web/node_modules/0x/index.js:83:27)
at process._tickCallback (internal/process/next_tick.js:68:7)
Any luck?
@ThomasGHenry no I have created the webpack configuration to build it. And then I run simple node
Thanks
@studentIvan - You need to provide JS to Clinic Flame.
Clinic.js currently does not work with apps or scripts that wrap node.js. That is, clinic has to be able to launch the node.js process directly because there are command-line flags and bits of code that need to be injected in order to enable the data collection instrumentation that is used. Coming up with a better strategy for this would be good tho, so we can add this to our roadmap to look into.
Clinic.js currently does not work with apps or scripts that wrap node.js. That is, clinic has to be able to launch the node.js process directly because there are command-line flags and bits of code that need to be injected in order to enable the data collection instrumentation that is used.
I guess clinicjs/node-clinic#441 is pretty much the same as this, and I see @DylanC also replied here: Instead of using babel-node one could just as easily consider using node --require @babel/register, which would still not work nicely (and likely misclassify the files, depending on how babel is configured then).
With more and more babel/typescript/something-to-js usage on the server side (at least from what I can see) it would be great to have a somewhat workable solution here, although documentation for "this is how you should do it" might be enough. After all one would typically want to verify the "production code" anyways for performance issues, so running through an on-the-fly transpiler isn't the best idea anyways. :)
I'm somewhat assuming (can't remember) that clinic does support source-maps though?
@ankon - Clinic does not support source maps currently. We are looking into supporting them in the future. First on the agenda will be to detect transpiled code/babel usage and provide a warning to the user.