Skip to content

TypeError: Cannot read properties of undefined (reading 'flags') #56402

Closed
@PranavSenthilnathan

Description

@PranavSenthilnathan

TypeError: Cannot read properties of undefined (reading 'flags')

Req #5859 - completionInfo
    at getSymbolLinks (/typescript-5.4.0-dev.20231105/lib/tsserver.js:49317:16)
    at runWithoutResolvedSignatureCaching (/typescript-5.4.0-dev.20231105/lib/tsserver.js:48396:32)
    at runWithInferenceBlockedFromSourceNode (/typescript-5.4.0-dev.20231105/lib/tsserver.js:48424:20)
    at Object.getContextualType (/typescript-5.4.0-dev.20231105/lib/tsserver.js:48133:16)
    at getContextualType (/typescript-5.4.0-dev.20231105/lib/tsserver.js:159233:19)
    at getCompletionData (/typescript-5.4.0-dev.20231105/lib/tsserver.js:159464:43)
    at Object.getCompletionsAtPosition (/typescript-5.4.0-dev.20231105/lib/tsserver.js:157444:26)
    at Object.getCompletionsAtPosition2 [as getCompletionsAtPosition] (/typescript-5.4.0-dev.20231105/lib/tsserver.js:145284:35)
    at IOSession.getCompletions (/typescript-5.4.0-dev.20231105/lib/tsserver.js:184857:54)
    at completionInfo (/typescript-5.4.0-dev.20231105/lib/tsserver.js:183253:43)
    at /typescript-5.4.0-dev.20231105/lib/tsserver.js:185641:69
    at IOSession.executeWithRequestId (/typescript-5.4.0-dev.20231105/lib/tsserver.js:185633:14)
    at IOSession.executeCommand (/typescript-5.4.0-dev.20231105/lib/tsserver.js:185641:29)
    at IOSession.onMessage (/typescript-5.4.0-dev.20231105/lib/tsserver.js:185683:51)
    at Interface.<anonymous> (/typescript-5.4.0-dev.20231105/lib/tsserver.js:187241:14)

Affected repos

dimsemenov/PhotoSwipe Raw error text: RepoResults7/dimsemenov.PhotoSwipe.rawError.txt in the artifact folder

Last few requests

{"seq":5856,"type":"request","command":"completionEntryDetails","arguments":{"file":"@PROJECT_ROOT@/dist/types/core/eventable.d.ts","line":917,"offset":4,"entryNames":["@abstract"]}}
{"seq":5857,"type":"request","command":"completionInfo","arguments":{"file":"@PROJECT_ROOT@/dist/types/core/eventable.d.ts","line":917,"offset":34,"includeExternalModuleExports":false,"triggerKind":2,"triggerCharacter":" "}}
{"seq":5858,"type":"request","command":"definitionAndBoundSpan","arguments":{"file":"@PROJECT_ROOT@/dist/types/core/eventable.d.ts","line":921,"offset":4}}
{"seq":5859,"type":"request","command":"completionInfo","arguments":{"file":"@PROJECT_ROOT@/dist/types/core/eventable.d.ts","line":925,"offset":48,"includeExternalModuleExports":false,"triggerKind":1}}

Repro steps

  1. git clone https://github.com/dimsemenov/PhotoSwipe --recurse-submodules
  2. In dir PhotoSwipe, run git reset --hard 2d23b36c99411d2dc45bf6610498754bf301b41c
  3. Install packages (exact steps are below, but it might be easier to follow the repo readme)
    1. In dir PhotoSwipe/demo-docs-website, run npm ci --prefer-offline --no-audit --no-progress --legacy-peer-deps --ignore-scripts -q
    2. In dir PhotoSwipe, run npm ci --prefer-offline --no-audit --no-progress --legacy-peer-deps --ignore-scripts -q
  4. Back in the initial folder, download RepoResults7/dimsemenov.PhotoSwipe.replay.txt from the artifact folder
  5. npm install --no-save @typescript/server-replay
  6. npx tsreplay ./PhotoSwipe ./dimsemenov.PhotoSwipe.replay.txt path/to/tsserver.js
  7. npx tsreplay --help to learn about helpful switches for debugging, logging, etc

Originally posted by @typescript-bot in #56319 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions