Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Cannot read properties of null (reading 'start') #5733

@Sceat

Description

@Sceat

Rollup Version

v4.27.2

Operating System (or Browser)

Mac M1 / Vercel

Node Version (if applicable)

v23

Link To Reproduction

https://github.com/aresrpg/aresrpg-dapp

Expected Behaviour

npm run build should run correctly

Since this PR aresrpg/aresrpg-dapp#165 which changes nothing concerning the bundling, it's impossible to build the app anymore. I've been looking for specific snippets that could have had impacted the build but nothing solves the issue.

The rollup code impacted is

            const colonPos = findFirstOccurrenceOutsideComment(code.original, ':', this.consequent.end);
            const inclusionStart = findNonWhiteSpace(code.original, (this.consequent.included
                ? findFirstOccurrenceOutsideComment(code.original, '?', this.test.end)
                : colonPos) + 1);
            if (preventASI) {
                removeLineBreaks(code, inclusionStart, usedBranch.start);
            }

usedBranch is null

Actual Behaviour

PWA v0.21.0
mode      generateSW
precache  19 entries (1105.59 KiB)
files generated
  dist/sw.js
  dist/workbox-1c98a0cb.js
error during build:
Cannot read properties of null (reading 'start')
    at ConditionalExpression.render (file:///aresrpg/aresrpg-dapp/node_modules/rollup/dist/es/shared/node-entry.js:11924:67)
    at ReturnStatement.render (file:///aresrpg/aresrpg-dapp/node_modules/rollup/dist/es/shared/node-entry.js:13850:27)
    at renderStatementList (file:///aresrpg/aresrpg-dapp/node_modules/rollup/dist/es/shared/node-entry.js:1851:25)
    at BlockStatement.render (file:///aresrpg/aresrpg-dapp/node_modules/rollup/dist/es/shared/node-entry.js:6341:13)
    at FunctionDeclaration.render (file:///aresrpg/aresrpg-dapp/node_modules/rollup/dist/es/shared/node-entry.js:2822:23)
    at renderStatementList (file:///aresrpg/aresrpg-dapp/node_modules/rollup/dist/es/shared/node-entry.js:1851:25)
    at Program.render (file:///aresrpg/aresrpg-dapp/node_modules/rollup/dist/es/shared/node-entry.js:13717:13)
    at Module.render (file:///aresrpg/aresrpg-dapp/node_modules/rollup/dist/es/shared/node-entry.js:16291:18)
    at Chunk.renderModules (file:///aresrpg/aresrpg-dapp/node_modules/rollup/dist/es/shared/node-entry.js:18039:41)
    at Chunk.render (file:///aresrpg/aresrpg-dapp/node_modules/rollup/dist/es/shared/node-entry.js:17528:111)

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