Vetur: Connection to server got closed. TypeError: Cannot read property 'get' of undefined

Created on 28 Apr 2017  路  11Comments  路  Source: vuejs/vetur

[Info - 涓婂崍9:17:16] Connection to server got closed. Server will restart.
C:\Users\administrtor.vscode\extensions\octref.vetur-0.6.4\client\servernode_modulestypescript\libtypescript.js:23318
var symbol = container.locals.get(node.text);
^

TypeError: Cannot read property 'get' of undefined
at isNameOfExportsOrModuleExportsAliasDeclaration (C:\Users\administrtor.vscode\extensions\octref.vetur-0.6.4\client\servernode_modulestypescript\libtypescript.js:23318:46)
at bindStaticPropertyAssignment (C:\Users\administrtor.vscode\extensions\octref.vetur-0.6.4\client\servernode_modulestypescript\libtypescript.js:23396:17)
at bindWorker (C:\Users\administrtor.vscode\extensions\octref.vetur-0.6.4\client\servernode_modulestypescript\libtypescript.js:23079:29)
at bind (C:\Users\administrtor.vscode\extensions\octref.vetur-0.6.4\client\servernode_modulestypescript\libtypescript.js:22974:13)
at bindConditionalExpressionFlow (C:\Users\administrtor.vscode\extensions\octref.vetur-0.6.4\client\servernode_modulestypescript\libtypescript.js:22441:13)
at bindChildrenWorker (C:\Users\administrtor.vscode\extensions\octref.vetur-0.6.4\client\servernode_modulestypescript\libtypescript.js:21837:21)
at bindChildren (C:\Users\administrtor.vscode\extensions\octref.vetur-0.6.4\client\servernode_modulestypescript\libtypescript.js:21746:17)
at bind (C:\Users\administrtor.vscode\extensions\octref.vetur-0.6.4\client\servernode_modulestypescript\libtypescript.js:22985:21)
at visitNode (C:\Users\administrtor.vscode\extensions\octref.vetur-0.6.4\client\servernode_modulestypescript\libtypescript.js:14662:20)
at Object.forEachChild (C:\Users\administrtor.vscode\extensions\octref.vetur-0.6.4\client\servernode_modulestypescript\libtypescript.js:14725:21)

bug docs

Most helpful comment

Try to include all your vue files in the include in your tsconfig.json or jsconfig.json.

Either

 "include": [
    "./src/**/*.ts",
    "./src/**/*.vue"
  ]

or

 "include": [
    "./src/**/*"
  ]

All 11 comments

Do you have a tsconfig/jsconfig in your project? If so can you share it with me?

I got the same issue:
The Vue Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted.
Here is the log:

Error: Could not find file: '/Users/zhengshaodong/Workspace/guazi/kong/src/components/casemgr/example/ComponentsUsage.vue'.
    at getValidSourceFile (/Users/zhengshaodong/.vscode/extensions/octref.vetur-0.6.4/client/server/node_modules/typescript/lib/typescript.js:84996:23)
    at Object.getSyntacticDiagnostics (/Users/zhengshaodong/.vscode/extensions/octref.vetur-0.6.4/client/server/node_modules/typescript/lib/typescript.js:85204:52)
    at Object.doValidation (/Users/zhengshaodong/.vscode/extensions/octref.vetur-0.6.4/client/server/modes/javascriptMode.js:131:49)
    at /Users/zhengshaodong/.vscode/extensions/octref.vetur-0.6.4/client/server/htmlServerMain.js:142:43
    at Array.forEach (native)
    at validateTextDocument (/Users/zhengshaodong/.vscode/extensions/octref.vetur-0.6.4/client/server/htmlServerMain.js:140:59)
    at Timeout._onTimeout (/Users/zhengshaodong/.vscode/extensions/octref.vetur-0.6.4/client/server/htmlServerMain.js:134:9)
    at tryOnTimeout (timers.js:232:11)
    at Timer.listOnTimeout (timers.js:202:5)
[Error - 5:33:10 PM] Connection to server got closed. Server will not be restarted.

My tsconfig.json file:

{
  "compilerOptions": {
    "allowJs": true,
    "target": "es5",
    "lib": [
      "dom",
      "es2015"
    ],
    "module": "commonjs",
    "moduleResolution": "node",
    "isolatedModules": false,
    "experimentalDecorators": true,
    "noImplicitAny": true,
    "noImplicitThis": true,
    "strictNullChecks": true,
    "removeComments": true,
    "suppressImplicitAnyIndexErrors": true,
    "allowSyntheticDefaultImports": true
  },
  "include": [
    "./src/**/*.ts"
  ],
  "compileOnSave": false
}

Try to include all your vue files in the include in your tsconfig.json or jsconfig.json.

Either

 "include": [
    "./src/**/*.ts",
    "./src/**/*.vue"
  ]

or

 "include": [
    "./src/**/*"
  ]

Please re-open this issue, I'm getting this error since a couple of days as well and I'm not even using typescript.

/Users/foo/.vscode/extensions/octref.vetur-0.6.4/client/server/node_modules/typescript/lib/typescript.js:23318
                var symbol = container.locals.get(node.text);

Additionally, I don't have a tsconfig/jsconfig file in my project

@TheDutchCoder Do you have a very large project? Or does your project include libraries such as jquery.min.js or bootstrap.min.js etc?

Try https://github.com/octref/vetur/issues/164#issuecomment-297864778 and let me know the output.

Nope, in fact a fairly small project, though a big repo where it resides.
I also have no external libs in my project aside from lodash.

Then can you try the method I posted above? It'll show the files that vetur is trying to do module resolution on.

There's 949 files that your extension is parsing through and there are large libraries in there like jQuery

@TheDutchCoder That'll be solved by #164. You can subscribe to it for progress.

@TheDutchCoder BTW, anything in that 949 files that's under node_modules?

Nope it doesn't seem to resolve anything from the node_modules directories, so just project files in this case.

Was this page helpful?
0 / 5 - 0 ratings