Typescript: НСвозмоТно ΠΏΡ€ΠΎΡ‡ΠΈΡ‚Π°Ρ‚ΡŒ свойство 'parent' для undefined Π² collectEnclosingScopes

Π‘ΠΎΠ·Π΄Π°Π½Π½Ρ‹ΠΉ Π½Π° 21 ΠΌΠ°Ρ€. 2019  Β·  3ΠšΠΎΠΌΠΌΠ΅Π½Ρ‚Π°Ρ€ΠΈΠΈ  Β·  Π˜ΡΡ‚ΠΎΡ‡Π½ΠΈΠΊ: microsoft/TypeScript


ВСрсия TypeScript: 3.4.0-rc

Ошибка

ΠŸΡ€ΠΈ Ρ€Π΅Π΄Π°ΠΊΡ‚ΠΈΡ€ΠΎΠ²Π°Π½ΠΈΠΈ ΠΊΠΎΠ΄Π° Π² VS Code я ΡƒΠ²ΠΈΠ΄Π΅Π» эту ΠΎΡˆΠΈΠ±ΠΊΡƒ. Π˜Π·Π²ΠΈΠ½ΠΈΡ‚Π΅, шагов Ρ€Π΅ΠΏΠΎ ΠΏΠΎΠΊΠ° Π½Π΅Ρ‚

  ERR TypeScript Server Error (3.4.0-rc)
Cannot read property 'parent' of undefined
TypeError: Cannot read property 'parent' of undefined
    at collectEnclosingScopes (tsserver.js:117195:127)
    at getPossibleExtractionsWorker (tsserver.js:117275:30)
    at getPossibleExtractions (tsserver.js:117232:26)
    at Object.getAvailableActions (tsserver.js:116745:35)
    at tsserver.js:111488:128
    at getIterator (tsserver.js:625:23)
    at Object.next (tsserver.js:620:35)
    at Object.arrayFrom (tsserver.js:1253:32)
    at Object.getApplicableRefactors (tsserver.js:111487:23)
    at Proxy.getApplicableRefactors (tsserver.js:121287:32)
    at IOSession.Session.getApplicableRefactors (tsserver.js:130013:53)
    at Session.handlers.ts.createMapFromTemplate._a.(anonymous function) (tsserver.js:128853:61)
    at tsserver.js:130237:88
    at IOSession.Session.executeWithRequestId (tsserver.js:130228:28)
    at IOSession.Session.executeCommand (tsserver.js:130237:33)
    at IOSession.Session.onMessage (tsserver.js:130259:35)
    at Interface.<anonymous> (tsserver.js:131556:27)
    at Interface.emit (events.js:182:13)
    at Interface._onLine (readline.js:290:10)
    at Interface._normalWrite (readline.js:433:12)
    at Socket.ondata (readline.js:149:10)
    at Socket.emit (events.js:182:13)
    at addChunk (_stream_readable.js:279:12)
    at readableAddChunk (_stream_readable.js:264:11)
    at Socket.Readable.push (_stream_readable.js:219:10)
    at Pipe.onread (net.js:636:20): Error: TypeScript Server Error (3.4.0-rc)

Π‘Π°ΠΌΡ‹ΠΉ ΠΏΠΎΠ»Π΅Π·Π½Ρ‹ΠΉ ΠΊΠΎΠΌΠΌΠ΅Π½Ρ‚Π°Ρ€ΠΈΠΉ

Π― Ρ‚ΠΎΠΆΠ΅ ΠΏΠΎΠ»ΡƒΡ‡ΠΈΠ» Π°Π½Π°Π»ΠΎΠ³ΠΈΡ‡Π½ΡƒΡŽ ΠΎΡˆΠΈΠ±ΠΊΡƒ:

ВСрсии TypeScript : 3.7.1-rc , 3.7.2 , 3.7.3-insiders.20191123

Ошибка Π½Π΅ Π²ΠΎΠ·Π½ΠΈΠΊΠ°Π΅Ρ‚ <=3.6.4

TypeError: Cannot read property 'parent' of undefined
    at Object.getDeclarationOfExpando (/<redacted>/node_modules/typescript/lib/tsc.js:8604:19)
    at getTypeOfFuncClassEnumModule (/<redacted>/node_modules/typescript/lib/tsc.js:32596:40)
    at getTypeOfSymbol (/<redacted>/node_modules/typescript/lib/tsc.js:32702:24)
    at getExternalModuleMember (/<redacted>/node_modules/typescript/lib/tsc.js:28512:64)
    at getTargetOfExportSpecifier (/<redacted>/node_modules/typescript/lib/tsc.js:28557:17)
    at getTargetOfAliasDeclaration (/<redacted>/node_modules/typescript/lib/tsc.js:28600:28)
    at resolveAlias (/<redacted>/node_modules/typescript/lib/tsc.js:28633:30)
    at resolveSymbol (/<redacted>/node_modules/typescript/lib/tsc.js:28623:67)
    at getSymbolIfSameReference (/<redacted>/node_modules/typescript/lib/tsc.js:29170:33)
    at /<redacted>/node_modules/typescript/lib/tsc.js:29164:21

ВсС 3 ΠšΠΎΠΌΠΌΠ΅Π½Ρ‚Π°Ρ€ΠΈΠΉ

ЕдинствСнноС мСсто, Π³Π΄Π΅ это ΠΌΠΎΠ³Π»ΠΎ ΠΏΡ€ΠΎΠΈΠ·ΠΎΠΉΡ‚ΠΈ Π² ΠΊΠΎΠ΄Π΅, - это здСсь:

        while (true) {
            current = current.parent;
            // A function parameter's initializer is actually in the outer scope, not the function declaration
            if (current.kind === SyntaxKind.Parameter) {
                // Skip all the way to the outer scope of the function that declared this parameter
                current = findAncestor(current, parent => isFunctionLikeDeclaration(parent))!.parent;
            }

Π― ΠΏΡ€Π΅Π΄ΠΏΠΎΠ»Π°Π³Π°ΡŽ, Ρ‡Ρ‚ΠΎ ΠΌΡ‹ нашли ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€ Π²Π½ΡƒΡ‚Ρ€ΠΈ JSDoc ΠΎΠΊΠΎΠ»ΠΎ Π²Π΅Ρ€Ρ…Π½Π΅Π³ΠΎ уровня, Π° Π·Π°Ρ‚Π΅ΠΌ ΠΏΠΎΠΏΡ‹Ρ‚Π°Π»ΠΈΡΡŒ ΠΏΠΎΠ΄ΠΎΠΉΡ‚ΠΈ ΠΊ Π²ΠΊΠ»ΡŽΡ‡Π°ΡŽΡ‰Π΅ΠΉ Ρ„ΡƒΠ½ΠΊΡ†ΠΈΠΈ decl, Π½ΠΎ Π½Π΅ нашли Π΅Π³ΠΎ ΠΈ ΠΎΡΡ‚Π°Π½ΠΎΠ²ΠΈΠ»ΠΈΡΡŒ.

findAncestor(...)! ΠΎΡ‡Π΅Π½ΡŒ ΠΏΠΎΠ΄ΠΎΠ·Ρ€ΠΈΡ‚Π΅Π»ΡŒΠ½ΠΎ, ΠΈ Π±Ρ‹Π»ΠΎ Π±Ρ‹ Π½Π΅ΠΏΠ»ΠΎΡ…ΠΎ Π΅Π³ΠΎ Π·Π°Π±Π°Π½ΠΈΡ‚ΡŒ ...

Π£ мСня похоТая ошибка:

ВСрсия: ΠΌΠ°ΡˆΠΈΠ½ΠΎΠΏΠΈΡΠ½Ρ‹ΠΉ тСкст 3.7.0-dev.20191017

ERROR in ./node_modules/hammerjs/hammer.js                                         
Module build failed (from ./node_modules/ts-loader/index.js):                       
TypeError: Cannot read property 'parent' of undefined                               
    at getOuterTypeParameters (/<redacted>/node_modules/typescript/lib/typescript.js:39886:29)                                   
    at getOuterTypeParametersOfClassOrInterface (/<redacted>/node_modules/typescript/lib/typescript.js:39944:20)
    at getDeclaredTypeOfClassOrInterface (/<redacted>/node_modules/typescript/lib/typescript.js:40217:43)
    at createAnonymousTypeNode (/<redacted>/node_modules/typescript/lib/typescript.js:36601:59)
    at typeToTypeNodeHelper (/<redacted>/node_modules/typescript/lib/typescript.js:36547:28)                                     
    at /<redacted>/node_modules/typescript/lib/typescript.js:36336:106
    at withContext (/<redacted>/node_modules/typescript/lib/typescript.js:36381:37)
    at Object.typeToTypeNode (/<redacted>/node_modules/typescript/lib/typescript.js:36336:28)
    at typeToString (/<redacted>/node_modules/typescript/lib/typescript.js:36303:40)                                             
    at reportNonexistentProperty (/<redacted>/node_modules/typescript/lib/typescript.js:54143:165)

Π― Ρ‚ΠΎΠΆΠ΅ ΠΏΠΎΠ»ΡƒΡ‡ΠΈΠ» Π°Π½Π°Π»ΠΎΠ³ΠΈΡ‡Π½ΡƒΡŽ ΠΎΡˆΠΈΠ±ΠΊΡƒ:

ВСрсии TypeScript : 3.7.1-rc , 3.7.2 , 3.7.3-insiders.20191123

Ошибка Π½Π΅ Π²ΠΎΠ·Π½ΠΈΠΊΠ°Π΅Ρ‚ <=3.6.4

TypeError: Cannot read property 'parent' of undefined
    at Object.getDeclarationOfExpando (/<redacted>/node_modules/typescript/lib/tsc.js:8604:19)
    at getTypeOfFuncClassEnumModule (/<redacted>/node_modules/typescript/lib/tsc.js:32596:40)
    at getTypeOfSymbol (/<redacted>/node_modules/typescript/lib/tsc.js:32702:24)
    at getExternalModuleMember (/<redacted>/node_modules/typescript/lib/tsc.js:28512:64)
    at getTargetOfExportSpecifier (/<redacted>/node_modules/typescript/lib/tsc.js:28557:17)
    at getTargetOfAliasDeclaration (/<redacted>/node_modules/typescript/lib/tsc.js:28600:28)
    at resolveAlias (/<redacted>/node_modules/typescript/lib/tsc.js:28633:30)
    at resolveSymbol (/<redacted>/node_modules/typescript/lib/tsc.js:28623:67)
    at getSymbolIfSameReference (/<redacted>/node_modules/typescript/lib/tsc.js:29170:33)
    at /<redacted>/node_modules/typescript/lib/tsc.js:29164:21
Π‘Ρ‹Π»Π° Π»ΠΈ эта страница ΠΏΠΎΠ»Π΅Π·Π½ΠΎΠΉ?
0 / 5 - 0 Ρ€Π΅ΠΉΡ‚ΠΈΠ½Π³ΠΈ