Skip to content

TypeError: Cannot read properties of undefined (reading 'indexOf') #5084

@janosh

Description

@janosh

Rollup Version

3.27.1

Operating System (or Browser)

macOS

Node Version (if applicable)

No response

Link To Reproduction

https://stackblitz.com/edit/rollup-repro-ughg9c?file=package.json

Expected Behaviour

npm run build succeeds.

Actual Behaviour

Lazy computing decoded mappings in #5075 seems to cause undefined mappings at vite build time in SvelteKit.

https://github.com/janosh/elementari/actions/runs/5754572660/job/15600143441#step:6:18

vite v4.4.8 building SSR bundle for production...
transforming...
✓ 5 modules transformed.
✓ built in 556ms
Cannot read properties of undefined (reading 'indexOf')
error during build:
TypeError: Cannot read properties of undefined (reading 'indexOf')
    at indexOf (file:///home/runner/work/elementari/elementari/node_modules/rollup/dist/es/shared/node-entry.js:91:26)
    at decode (file:///home/runner/work/elementari/elementari/node_modules/rollup/dist/es/shared/node-entry.js:54:22)
    at get mappings [as mappings] (file:///home/runner/work/elementari/elementari/node_modules/rollup/dist/es/shared/node-entry.js:13281:37)
    at decodedSourcemap (file:///home/runner/work/elementari/elementari/node_modules/rollup/dist/es/shared/node-entry.js:13254:13)
    at file:///home/runner/work/elementari/elementari/node_modules/rollup/dist/es/shared/node-entry.js:13997:104
    at Array.map (<anonymous>)
    at Module.setSource (file:///home/runner/work/elementari/elementari/node_modules/rollup/dist/es/shared/node-entry.js:13997:46)
    at ModuleLoader.addModuleSource (file:///home/runner/work/elementari/elementari/node_modules/rollup/dist/es/shared/node-entry.js:24523:[20](https://github.com/janosh/elementari/actions/runs/5754572660/job/15600143441#step:6:21))

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions