-
Notifications
You must be signed in to change notification settings - Fork 306
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
Continuous profiling not working with NextJS instrumentation #4243
Comments
Hey, after some debugging we found that the issue was that Have created a upstream fix here awaiting merge. Tagging maintainers as this is an actual bug that will prevent nextjs |
Thank you for the upstream fix! Do you think this could be done in a more generic way? We have more native extensions than just profiling and we have more coming as well. Having to remember to update a list in an external project, while doable, is definitely not ideal. |
To be honest, I'm not sure if this is a unique case because vercel has their own tree-shaking logic for For this specific case, the most intuitive DX I could imagine that would not require too many changes on Then, your team could add some specific code snippets for users to include in This seems to be the best middleground without sprinkling moar AST magic 🧙 into their code haha (if you are interested, can have a look at vercel/nft#392, which was a fix for another module, this involved just hardcoding another way to handle imports which banked on the fact that Hope this makes sense! |
Hey, @austinwoon do you know of any workaround I could apply to my repo since I'm not able to upgrade the Nextjs version from 13.x to 14.x? |
Manually install this package and transfer into to stand alone mode's node modules package. Not ideal but will work. |
I have a similar issue when running the NextJS v14.2.10 in a standalone mode. When the function _startProfiler is called, I get the following error
Is there a way to work around this in the current NextJS version and the latest /cc @austinwoon Maybe you can help here? |
Hi @Neurostep, Attila from Datadog profiling team here. @austinwoon's comment just above yours includes a very tersely formulated workaround, I'll try to expand on it in in more detail. This workaround is unfortunately still required today as the dependency bump in next.js to pull in the fix from the nft library is only slated for next.js versions 14.3.0 and 15.0.0. 14.3.0 in particular seems to be in a release limbo for months now. In our own testing with next.js, we noticed that the application version emitted by the bundler in its
will complete the missing dependencies and make the profiler work. There's few more libraries under the If you're concerned that this brings in too many dependencies, you can also try to create an empty sample application, use npm to install dd-trace into it, then copy only
It does sound from your error message that you already might have a part of the profiler library (supposedly the JS files only) installed, and it's only the native code shared libraries that are missing; those would normally reside in Hope that helps! |
Hi @szegedi 👋 Thank you for the thorough explanation, that is very helpful 🙏 I have tried to fix the problem by copying the cp -r node_modules/@datadog/pprof $YOUR_APP/.next/standalone/node_modules/@datadog Otherwise, we end up having the |
Thank you! I updated the instructions to reflect that. |
Getting no profiles in the APM section after setting the following configs to tracer on NextJS.
Could I check if this is a bug or I have to enable something else on my end? Thank you.
The text was updated successfully, but these errors were encountered: