Unable to track errors with elastic-apm-node in Nextjs App

APM Server version:

APM Agent language and version:

Browser version:
Chrome 112

Original install method (e.g. download page, yum, deb, from source, etc.) and version:
yarn add elastic-apm-node

Fresh install or upgraded from other version?
Fresh install

Is there anything special in your setup?
No special setup for my side

Description of the problem including expected versus actual behavior. Please include screenshots (if relevant):
Runtime scripts errors are not tracked in Elastic APM.

Steps to reproduce:

  1. Runtime errors are shown in the browser console
  2. Browser consoles are not tracked in Elastic APM
  3. It's only tracking the Nextjs app core hydration issue only.

Errors in browser console (if relevant):
Failed to load resource: the server responded with a status of 404 (Not Found)

next-dev.js:20 Error: Cannot read properties of undefined (reading 'length')

Provide logs and/or server output (if relevant):

Hi @prakashks, thanks for the question.

I'd need more details (full log output, full stacktrace from that Cannot read properties of undefined (reading 'length') error) to be able to help figure out what the issue is.

@trentm The issue occurred when checking the data length at run time(Data value is undefined at runtime).

@trentm Any update?

@prakashks Just that one line of log output isn't enough for me to try to determine where the error could be. Can you provide a more complete log file of the running app?

At a minimum, can you show the full stacktrace? This would be a number of lines before and/or after the next-dev.js:20 Error: Cannot read properties of undefined (reading 'length') line.

Ideally you could send full trace-level log output from elastic-apm-node while running your app. You can turn trace-level logging on as described here: Troubleshooting | APM Node.js Agent Reference [3.x] | Elastic

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.