-
-
Notifications
You must be signed in to change notification settings - Fork 594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vetur crashes if checkJs is set to true and a vue file which modifies a watched value is opened #751
Comments
Thanks for reporting. I guess this problem comes from TS server. I will investigate more and report issue to related team. |
I saw this error: .vscode/extensions/octref.vetur-0.11.7/server/node_modules/typescript/lib/typescript.js:72587 TypeError: Cannot read property 'parameters' of undefined |
Boiled down version: func.ts interface ComponentOptions<V> {
watch: Record<string, WatchHandler<any>>;
}
type WatchHandler<T> = (val: T) => void;
declare function extend(options: ComponentOptions<{}>): void;
export var vextend = extend import {vextend} from './func'
// hover on vextend
export var a = vextend({
watch: {
data1(val) {
this.data2 = 1
},
data2(val) { }
}
}) tsconfig.json {
"compilerOptions": {
"checkJs": true,
"allowJs": true
}
} Error:
|
This issue has already been tracked in microsoft/TypeScript#23198. Let's patiently await TS team's fix. Meanwhile we cannot do much in Vue side, so I will close this issue for now. |
@HerringtonDarkholme Can this be fixed now that microsoft/TypeScript#23198 has been closed? The latest version of Vetur (0.16.2) still crashes on the reproduction repository mentioned above. |
This seems to be solved in TS 3.3, which you can get by:
See #682 for details. This issue will be completely gone after #1163. |
@octref Thanks! That fixes the issue. |
There is a longstanding Vetur bug that causes it to crash in this project. Using Typescript version 3.3 fixes the bug but Vetur hasn't updated to it yet. Thus, this version of Typescript must be instlalled locally until Vetur is updated. See vuejs/vetur#751 (comment)
Info
Problem
When
checkJs
is set to true intsconfig.json
orjsconfig.json
and a.vue
file which modifies a watched value is opened, Vetur crashes.Vetur crashing on files like this is almost identical to #191 (comment)
There is no output from Vue Language Server as it appears to crash. However, there is output from the Window log:
Extensions
CoenraadS.bracket-pair-colorizerEditorConfig.EditorConfig
Keno.uikit-3-snippets
Shan.code-settings-sync
Sophisticode.php-formatter
WakaTime.vscode-wakatime
asabil.meson
christian-kohler.npm-intellisense
christian-kohler.path-intellisense
dbaeumer.vscode-eslint
demijollamaxime.bulma
donjayamanne.githistory
ecmel.vscode-html-css
felixfbecker.php-intellisense
formulahendry.auto-close-tag
formulahendry.auto-rename-tag
hnw.vscode-auto-open-markdown-preview
joelday.docthis
mblode.twig-language
minhthai.vscode-todo-parser
ms-python.python
octref.vetur
patrys.vscode-code-outline
rebornix.project-snippets
robertohuertasm.vscode-icons
wayou.vscode-todo-highlight
yycalm.linecount
zhuangtongfa.Material-theme
Reproducible Case
Open nextgensparx/veturpack in VS Code and then
client/components/Test.vue
.It's worth noting that if
data2
is changed todata3
in watch, the issue goes away.The text was updated successfully, but these errors were encountered: