Skip to content

TypeError: Cannot read properties of undefined (reading 'start') #3

@almereyda

Description

@almereyda

When trying to build this project, a traceback is thrown:

file:///home/username/src/project/node_modules/.pnpm/@braindb[email protected]/node_modules/@braindb/core/dist/addDocument.js:143
            const start = node.position.start.offset;
                                        ^

TypeError: Cannot read properties of undefined (reading 'start')
    at file:///home/username/src/project/node_modules/.pnpm/@braindb[email protected]/node_modules/@braindb/core/dist/addDocument.js:143:41
    at overload (file:///home/username/src/project/node_modules/.pnpm/[email protected]/node_modules/unist-util-visit/lib/index.js:311:12)
    at node (link) (file:///home/username/src/project/node_modules/.pnpm/[email protected]/node_modules/unist-util-visit-parents/lib/index.js:346:27)
    at node (paragraph) (file:///home/username/src/project/node_modules/.pnpm/[email protected]/node_modules/unist-util-visit-parents/lib/index.js:363:61)
    at node (listItem) (file:///home/username/src/project/node_modules/.pnpm/[email protected]/node_modules/unist-util-visit-parents/lib/index.js:363:61)
    at node (list) (file:///home/username/src/project/node_modules/.pnpm/[email protected]/node_modules/unist-util-visit-parents/lib/index.js:363:61)
    at node (root) (file:///home/username/src/project/node_modules/.pnpm/[email protected]/node_modules/unist-util-visit-parents/lib/index.js:363:61)
    at visitParents (file:///home/username/src/project/node_modules/.pnpm/[email protected]/node_modules/unist-util-visit-parents/lib/index.js:304:31)
    at visit (file:///home/username/src/project/node_modules/.pnpm/[email protected]/node_modules/unist-util-visit/lib/index.js:302:3)
    at addDocument (file:///home/username/src/project/node_modules/.pnpm/@braindb[email protected]/node_modules/@braindb/core/dist/addDocument.js:107:5)

This happened after installing with Node v22.11.0, pnpm 10.11.0, including listing better-sqlite3 in the onlyBuiltDependencies key of pnpm-workspace.yaml.

For not knowing which of these identical lines is transpiled into line 143 of addDocument.js, both are a candidate for debugging this case:

const start = node.position.start.offset as number;

const start = node.position.start.offset as number;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions