Vetur: Server still crash on 0.6.1 - throw new Error("start < 0");

Created on 20 Apr 2017  路  10Comments  路  Source: vuejs/vetur

Still having issue with server, last VSCode version on ArchLinux updated with node v7.8.0

/home/xxxxxx/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:10566
            throw new Error("start < 0");
            ^

Error: start < 0
    at createTextSpan (/home/xxxxxx/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:10566:19)
    at Object.createTextSpanFromBounds (/home/xxxxxx/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:10575:16)
    at getErrorSpanForNode (/home/xxxxxx/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:7075:19)
    at createDiagnosticForNodeInSourceFile (/home/xxxxxx/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:6999:20)
    at Object.createDiagnosticForNode (/home/xxxxxx/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:6995:16)
    at /home/xxxxxx/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:21582:58
    at Object.forEach (/home/xxxxxx/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:1423:30)
    at declareSymbol (/home/xxxxxx/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:21581:28)
    at declareModuleMember (/home/xxxxxx/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:21600:28)
    at declareSourceFileMember (/home/xxxxxx/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:22646:19)
    at declareSymbolAndAddToSymbolTableWorker (/home/xxxxxx/.vscode/extensions/octref.vetur-0.6.1/client/server/node_modules/typescript/lib/typescript.js:22596:28)
[Error - 7:43:37 PM] Connection to server got closed. Server will not be restarted.

Most helpful comment

It's because vetur 0.6 inserts a hidden import Vue from 'vue' for you. I forgot that people might still want to write it explicitly. In that case, it should not insert a hidden one.

All 10 comments

Can you help me finding a repro? Try it on some public vue projects like https://github.com/vuejs/vue-hackernews-2.0 or https://github.com/vuejs-templates/webpack and see if the server crashes? If not, can you try to put some code from your codebase to a template project and manage to crash vetur's Language Server?

This is what @The-Smallest did and was extremely helpful for me to fix the previous crash:

image

It's crashing for me too on startup, let me see if I can reproduce.

It's happening to me as well. I just created a stock asp.net core web api project using the yeoman generator and as soon as I opened the project it it started crashing.

npm install -g yo bower
npm install -g [email protected]
yo aspnet

@octref
I find the crashed reason.
If in a vue file script tag write import Vue, that will cause crash.
writeimport vue do not cause crash.
reason

@jing2si

Thanks! I'm able to repro it. Will look into a fix soon.

It's because vetur 0.6 inserts a hidden import Vue from 'vue' for you. I forgot that people might still want to write it explicitly. In that case, it should not insert a hidden one.

@jing2si Thanks for the repro.

For people having this problem, 0.6.2 is published with @sandersn's fix. Please give it a try.
@jing2si's case is resolved by 0.6.2 at least.

0.6.2 fixed it for me too, thanks! 馃憤

It seems to be fixed but I am experiencing abnormal performance issues. For example, if auto-complete is triggered it shows a loading sign which stays for some seconds until the auto-complete dialog shows up. Is anyone else experiencing this?

It used to be really fast (Instant completion-info) for my project which hasn't changed in a few weeks.

Also is it normal that the vetur server process uses like 1-2 GiB ram?

@cynecx That's not normal. I'm looking into that in #131.

Was this page helpful?
0 / 5 - 0 ratings