-
-
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
Undefined valueDeclaration in props is crashing vls #2367
Labels
Comments
javiertury
added a commit
to javiertury/vetur
that referenced
this issue
Oct 9, 2020
javiertury
added a commit
to javiertury/vetur
that referenced
this issue
Oct 9, 2020
javiertury
changed the title
valueDeclaration can be undefined
Undefined valueDeclaration in props is crashing vls
Oct 9, 2020
I don't think it's legal to write in The right way: import { PropType } from 'vue'
// Properties options
const props = {
value: {
type: Function as PropType<() => Reource | undefined>,
required: false
}
};
// Component
export default defineComponent({
props,
setup(props, { root: { $router } }) {
...
}
}); But I agree we need to deal with this crash. |
javiertury
added a commit
to javiertury/vetur
that referenced
this issue
Oct 10, 2020
Before vetur gained support to check properties in templates, the scheme above was the only way to reliably check property types in both parent and child components. But now I agree, the scheme I used above should not be used. |
octref
added a commit
that referenced
this issue
Oct 29, 2020
Fix undefined valueDeclaration in props crashing vls (#2367)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Info
Problem
Vetur is continuously crashing because
s.valueDeclaration
can beundefined
here:vetur/server/src/modes/script/componentInfo.ts
Lines 322 to 324 in a733125
I propose to use instead
Reproducible Case
Debugging the issue the problem is the line
value: T | undefined
(obtained froms.declarations[0].getText()
). This line is part of the following fragment.Later this type is used to build properties:
And also used in parents to create an object of properties that will be binded to the component.
EDIT: fix code typo
The text was updated successfully, but these errors were encountered: