Skip to content

QuickFix error: add missing import with already reexported variable #18272

Closed
@GiedriusGrabauskas

Description

@GiedriusGrabauskas

TypeScript Version: nightly (2.6.0-dev.20170904)

Code

./a.ts

export const A_VALUE: string = "ASTRING";

./b.ts

export { A_VALUE } from "./a";

A_VALUE // Using quick fix here

Actual behavior:

'getCodeFixes' request failed with error.
Error processing request. Cannot read property 'kind' of undefined
TypeError: Cannot read property 'kind' of undefined
    at getCodeActionsForExistingImport (d:\test\ts-error5\node_modules\typescript\lib\tsserver.js:74051:40)
    at getCodeActionForImport (d:\test\ts-error5\node_modules\typescript\lib\tsserver.js:74039:28)
    at Object.getImportCodeActions [as getCodeActions] (d:\test\ts-error5\node_modules\typescript\lib\tsserver.js:73995:60)
    at d:\test\ts-error5\node_modules\typescript\lib\tsserver.js:73159:33
    at Object.forEach (d:\test\ts-error5\node_modules\typescript\lib\tsserver.js:1292:30)
    at Object.getFixes (d:\test\ts-error5\node_modules\typescript\lib\tsserver.js:73158:16)
    at d:\test\ts-error5\node_modules\typescript\lib\tsserver.js:77017:35
    at Object.flatMap (d:\test\ts-error5\node_modules\typescript\lib\tsserver.js:1524:25)
    at Object.getCodeFixesAtPosition (d:\test\ts-error5\node_modules\typescript\lib\tsserver.js:77015:23)
    at IOSession.Session.getCodeFixes (d:\test\ts-error5\node_modules\typescript\lib\tsserver.js:83053:64)
    at Session.handlers.ts.createMapFromTemplate._a.(anonymous function) (d:\test\ts-error5\node_modules\typescript\lib\tsserver.js:81971:61)
    at d:\test\ts-error5\node_modules\typescript\lib\tsserver.js:83197:88
    at IOSession.Session.executeWithRequestId (d:\test\ts-error5\node_modules\typescript\lib\tsserver.js:83188:28)
    at IOSession.Session.executeCommand (d:\test\ts-error5\node_modules\typescript\lib\tsserver.js:83197:33)
    at IOSession.Session.onMessage (d:\test\ts-error5\node_modules\typescript\lib\tsserver.js:83217:35)
    at Interface.<anonymous> (d:\test\ts-error5\node_modules\typescript\lib\tsserver.js:84307:27)
    at emitOne (events.js:96:13)
    at Interface.emit (events.js:188:7)
    at Interface._onLine (readline.js:247:10)
    at Interface.<anonymous> (readline.js:384:12)
    at Array.forEach (native)
    at Interface._normalWrite (readline.js:383:11)
    at Socket.ondata (readline.js:107:10)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:176:18)
    at Socket.Readable.push (_stream_readable.js:134:10)
    at Pipe.onread (net.js:551:20)

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions