-
Notifications
You must be signed in to change notification settings - Fork 225
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
next js output standalone - next:13.2.1, elastic-apm-node: 3.46.0 #3342
Comments
That looks wrong. I think it should be either:
or
I'm not sure this is the issue you are having, however. |
Also, as I mentioned at #1611 (comment) I wonder if standalone mode is just completely broken in next@13.x. Can you should a recursive directory listing of |
@trentm I tried:
And always the result was the same. Standalone mode itself works in "next": "13.2.1". Only elastic-apm-node does not work. |
@trentm in order for everything to work in nextjs in output standalone mode, you need:
Library versions: My final Dockerfile is more complicated since I don't run apm everywhere, but a simplified version would look like this:
|
I am getting something similar with a more verbose error message below:
These files are indeed not present in the traced output. Can we make sure to add the proper require/include statement such that they are picked up? I believe NextJS uses this tool to do the tracing https://github.com/vercel/nft. Note; I think the scope is broader to framework that use output file tracing solutions |
Describe the bug
To Reproduce
I have a monorepo with several applications. Package manager - pnpm v8.4.0.
my Dockerfile:
I have a elastic-apm-node.js
In normal mode, everything worked - the Dockerfile was a little different. When I turned on output: standalone - apm stopped working.
You told me to import the api route package to include in the bundle. The package really dragged on and locally it seemed to even start. But when I build in ci - module not found at startup.
I solved this by removing the options for node
NODE_OPTIONS=--require=elastic-apm-node/start-next.js
from the Dockerfile and running apm agent manually in api routes. The agent worked, but now it says that the routes are unknownExpected behavior
Working apm agent with
output: standalone
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(...)
) -work, but routes are unknown
elastic-apm-node/start
from within the source code-r elastic-apm-node/start
-module not found
The text was updated successfully, but these errors were encountered: