Skip to content

TypeError: Cannot read property 'length' of undefined in computeLineStarts #40747

@btakita

Description

@btakita

Release version 4.0.3

(cd dom-lib-loader && tsc)

Results:

/work/project/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/tsc.js:6040
        while (pos < text.length) {
                          ^
TypeError: Cannot read property 'length' of undefined
    at computeLineStarts (/work/project/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/tsc.js:6040:27)
    at Object.getLineStarts (/work/project/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/tsc.js:6093:60)
    at getCurrentLineMap (/work/project/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/tsc.js:79723:59)
    at emitDetachedCommentsAndUpdateCommentsInfo (/work/project/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/tsc.js:83011:94)
    at emitBodyWithDetachedComments (/work/project/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/tsc.js:82884:17)
    at emitSourceFile (/work/project/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/tsc.js:81753:21)
    at pipelineEmitWithHint (/work/project/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/tsc.js:79800:24)
    at pipelineEmit (/work/project/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/tsc.js:79756:13)
    at print (/work/project/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/tsc.js:79690:13)
    at Object.writeFile (/work/project/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/tsc.js:79674:13)

The project build:

tsc -b $dirs -W

Results:

[9:31:08 AM] Starting compilation in watch mode...

error TS6059: File '/work/project/libs/dom-lib-loader/index.ts' is not under 'rootDir' '/work/project/libs/chat-ui'. 'rootDir' is expected to contain all source files.

error TS6307: File '/work/project/libs/dom-lib-loader/index.ts' is not listed within the file list of project '/work/project/libs/chat-ui/tsconfig.json'. Projects must list all files or use an 'include' pattern.

[9:31:10 AM] Found 2 errors. Watching for file changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions