-
Notifications
You must be signed in to change notification settings - Fork 229
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
Agent not working with Yarn Pnp + NextJS #4000
Comments
basically what happens is that The getting started guide assumes this var is not set so the npm scripts
overriding its value and making the You can change the script to append the required value into node options. This is an example
This will maintain reference to the required loaders and append the agent start script at the end. Cheers! |
Hello @david-luna, I have tried your suggestion and it did work in this repository with the nextjs example. When it came to try it with my project, I had this error : Error: Qualified path resolution failed: we looked for the following paths, but none could be accessed. Source path: /workspace/next it seem it wasn't able to start next. I change your suggestion to
This seem to be working. do you see any issue with the change I made ? |
Maybe we weren't using the same |
As per your last comment in assume the issue is fixed. Should I proceed to close it? |
Yes, thank you |
Describe the bug
When running the apm agent following the documentation for a nextjs project, using Yarn Berry with Pnp, I get this error :
Error: Cannot find module 'elastic-apm-node/start-next.js'
To Reproduce
Steps to reproduce the behavior:
nodeLinker: pnp
in .yarnrc.ymlExpected behavior
I expected the apm to start.
Environment (please complete the following information)
How are you starting the agent? (please tick one of the boxes)
agent.start()
directly (e.g.require('elastic-apm-node').start(...)
)elastic-apm-node/start
from within the source code-r elastic-apm-node/start
The text was updated successfully, but these errors were encountered: