getappmap / getappmap/appmap-node

ReferenceError when running Next.js app with AppMap

Open
#175 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
13
Forks
6
Avg merge
18h 23m
Merged PRs (30d)
8

Description

Hello AppMap team,

I encountered an issue while trying to run my Next.js application with AppMap. When executing the command npx appmap-node npx next start, I received the following error:

⨯ ReferenceError: Cannot access 'default' before initialization
at Object.default (webpack-internal:///./node_modules/next/dist/client/router.js:21:9)
at Function.entries (<anonymous>)
at propertiesSchema (/node_modules/appmap-node/dist/parameter.js:143:19)
at parameterSchema (/node_modules/appmap-node/dist/parameter.js:120:29)
at parameter (/node_modules/appmap-node/dist/parameter.js:21:20)
at optParameter (/node_modules/appmap-node/dist/parameter.js:90:12)
at makeReturnEvent (/node_modules/appmap-node/dist/event.js:31:52)
at Recording.functionReturn (/node_modules/appmap-node/dist/Recording.js:56:51)
at /node_modules/appmap-node/dist/recorder.js:100:58
at Array.forEach (<anonymous>)
at record (/node_modules/appmap-node/dist/recorder.js:100:20)
at webpack_require (/build/server/webpack-runtime.js:33:27)

It seems that there might be an incompatibility between AppMap and my Next.js project, specifically related to the router initialization.

Environment:

  • Next.js version: 14.2.3
  • AppMap version: 2.24.3
  • Node.js version: 18.17.1

Thank you!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing npx appmap-node npx next start with Next.js 14.2.3, AppMap 2.24.3, and Node.js 18.17.1. Trace the failure through the reported appmap-node/dist/parameter.js, event.js, Recording.js, and recorder.js paths, then verify that the Next.js app starts without the ReferenceError.

Written by the indexing model from the issue text.

Assessment

Tech stack
next.js, node.js, typescript
Domain
backend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.