rollup error - "Cannot read properties of undefined (reading '0')" on `npm run build`
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- node.js, rollup, typescript, vite
- Domain
- build-system
Research direction
Reproduce the failure with npm init marko -- -t basic, then run npm run build and trace the stack through @marko/run, Vite, and Rollup at node_modules/rollup/dist/es/shared/node-entry.js. Done means the generated basic Marko project builds successfully on the reported environments without the sourcemap error.
Written by the indexing model from the issue text.
Description
node_modules/rollup/dist/es/shared/node-entry.js:20199
return source.traceSegment(segment[2], segment[3], segment.length === 5 ? this.names[segment[4]] : name);
^
Cannot read properties of undefined (reading '0')
Reproduce steps:
npm init marko -- -t basiccd my-appnpm run build
Versions:
- M3 MacBook, macOS 15.6.1
- node v22.14.0
- [email protected]
- [email protected]
~/Developer/Scratch % npm init marko -- -t basic
> npx
> create-marko -t basic
✔ Type your project name · my-app
✔ Project created! To get started, run:
cd my-app
npm run dev
~/Developer/Scratch % cd my-app
~/Developer/Scratch/my-app % npm ls vite rollup @marko/run git:(main)
[email protected] /Users/iankulin/Developer/Scratch/my-app
└─┬ @marko/[email protected]
├─┬ @marko/[email protected]
│ └── @marko/[email protected] deduped
├─┬ @marko/[email protected]
│ └── [email protected] deduped
└─┬ [email protected]
└── [email protected]
~/Developer/Scratch/my-app % node -v git:(main)
v22.14.0
~/Developer/Scratch/my-app % npm run build git:(main)
> [email protected] build
> marko-run build
✗ Build failed in 45ms
file:///Users/iankulin/Developer/Scratch/my-app/node_modules/rollup/dist/es/shared/node-entry.js:20199
return source.traceSegment(segment[2], segment[3], segment.length === 5 ? this.names[segment[4]] : name);
^
Cannot read properties of undefined (reading '0')
at Link.traceSegment (file:///Users/iankulin/Developer/Scratch/my-app/node_modules/rollup/dist/es/shared/node-entry.js:20199:101)
at Link.traceSegment (file:///Users/iankulin/Developer/Scratch/my-app/node_modules/rollup/dist/es/shared/node-entry.js:20199:31)
at Link.traceMappings (file:///Users/iankulin/Developer/Scratch/my-app/node_modules/rollup/dist/es/shared/node-entry.js:20141:39)
at collapseSourcemaps (file:///Users/iankulin/Developer/Scratch/my-app/node_modules/rollup/dist/es/shared/node-entry.js:20245:63)
at transformChunk (file:///Users/iankulin/Developer/Scratch/my-app/node_modules/rollup/dist/es/shared/node-entry.js:20349:15)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async file:///Users/iankulin/Developer/Scratch/my-app/node_modules/rollup/dist/es/shared/node-entry.js:20395:17
at async Promise.all (index 0)
at async transformChunksAndGenerateContentHashes (file:///Users/iankulin/Developer/Scratch/my-app/node_modules/rollup/dist/es/shared/node-entry.js:20390:5)
at async renderChunks (file:///Users/iankulin/Developer/Scratch/my-app/node_modules/rollup/dist/es/shared/node-entry.js:20299:151)
at async Bundle.generate (file:///Users/iankulin/Developer/Scratch/my-app/node_modules/rollup/dist/es/shared/node-entry.js:20558:13)
at async file:///Users/iankulin/Developer/Scratch/my-app/node_modules/rollup/dist/es/shared/node-entry.js:23424:27
at async catchUnfinishedHookActions (file:///Users/iankulin/Developer/Scratch/my-app/node_modules/rollup/dist/es/shared/node-entry.js:22791:16)
at async buildEnvironment (file:///Users/iankulin/Developer/Scratch/my-app/node_modules/vite/dist/node/chunks/config.js:34162:64)
at async Object.build (file:///Users/iankulin/Developer/Scratch/my-app/node_modules/vite/dist/node/chunks/config.js:34519:19)
at async build (file:///Users/iankulin/Developer/Scratch/my-app/node_modules/@marko/run/dist/cli/index.mjs:2726:3)
at async file:///Users/iankulin/Developer/Scratch/my-app/node_modules/@marko/run/dist/cli/index.mjs:2802:3
Node.js v22.14.0
and on a Debian VM:
ian@vm601-marko:~$ npm init marko -- -t basic
Need to install the following packages:
[email protected]
Ok to proceed? (y)
> npx
> "create-marko" -t basic
✔ Type your project name · my-app
✔ Project created! To get started, run:
cd my-app
npm run dev
ian@vm601-marko:~$ cd my-app
ian@vm601-marko:~/my-app$ npm ls vite rollup @marko/run
[email protected] /home/ian/my-app
└─┬ @marko/[email protected]
├─┬ @marko/[email protected]
│ └── @marko/[email protected] deduped
├─┬ @marko/[email protected]
│ └── [email protected] deduped
└─┬ [email protected]
└── [email protected]
ian@vm601-marko:~/my-app$ node -v
v22.21.0
ian@vm601-marko:~/my-app$ npm run build
> [email protected] build
> marko-run build
✗ Build failed in 268ms
file:///home/ian/my-app/node_modules/rollup/dist/es/shared/node-entry.js:20199
return source.traceSegment(segment[2], segment[3], segment.length === 5 ? this.names[segment[4]] : name);
^
Cannot read properties of undefined (reading '0')
at Link.traceSegment (file:///home/ian/my-app/node_modules/rollup/dist/es/shared/node-entry.js:20199:101)
at Link.traceSegment (file:///home/ian/my-app/node_modules/rollup/dist/es/shared/node-entry.js:20199:31)
at Link.traceMappings (file:///home/ian/my-app/node_modules/rollup/dist/es/shared/node-entry.js:20141:39)
at collapseSourcemaps (file:///home/ian/my-app/node_modules/rollup/dist/es/shared/node-entry.js:20245:63)
at transformChunk (file:///home/ian/my-app/node_modules/rollup/dist/es/shared/node-entry.js:20349:15)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async file:///home/ian/my-app/node_modules/rollup/dist/es/shared/node-entry.js:20395:17
at async Promise.all (index 0)
at async transformChunksAndGenerateContentHashes (file:///home/ian/my-app/node_modules/rollup/dist/es/shared/node-entry.js:20390:5)
at async renderChunks (file:///home/ian/my-app/node_modules/rollup/dist/es/shared/node-entry.js:20299:151)
at async Bundle.generate (file:///home/ian/my-app/node_modules/rollup/dist/es/shared/node-entry.js:20558:13)
at async file:///home/ian/my-app/node_modules/rollup/dist/es/shared/node-entry.js:23424:27
at async catchUnfinishedHookActions (file:///home/ian/my-app/node_modules/rollup/dist/es/shared/node-entry.js:22791:16)
at async buildEnvironment (file:///home/ian/my-app/node_modules/vite/dist/node/chunks/config.js:34162:64)
at async Object.build (file:///home/ian/my-app/node_modules/vite/dist/node/chunks/config.js:34519:19)
at async build (file:///home/ian/my-app/node_modules/@marko/run/dist/cli/index.mjs:2726:3)
at async file:///home/ian/my-app/node_modules/@marko/run/dist/cli/index.mjs:2802:3
Node.js v22.21.0
ian@vm601-marko:~/my-app$
- Dominant language
- TypeScript
- Stars
- 175
- Forks
- 16
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 6
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from marko-js/run
-
DEP0190: spawnServer passes args array with shell:true, triggering Node v26 deprecation warningOpen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
Maintainers usually reply within 1 day
Similar issues
-
refactor
Difficulty 2/5 Half a day Newbie friendliness 84/100
Maintainers usually reply within 5 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
OHDSI/Data2Evidence#3450 ·
Maintainers usually reply within 2 days
-
e2e-failure ready-to-code
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
redhat-developer/rhdh-plugin-export-overlays#4011 · 1 comment ·
Maintainers usually reply within 1 day
-
automation missing-model model-sync provider:ofox
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
anomalyco/models.dev#8421 ·
Maintainers usually reply within 1 day
-
SlackAdapter and TelegramAdapter are not assignable to Adapter under exactOptionalPropertyTypesOpen
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day