Closed kingychiu closed 3 months ago
Duplicate of https://github.com/vuejs/language-tools/issues/4209
@so1ve How about the issue within node_modules?
@kingychiu Which file should #build/nuxt-time-script.mjs
be resolved to? I can't find a nuxt-time-script.mjs
file.
hi @johnsoncodehk, that mjs file is used by the nuxt-time
package as shown in the reproduction. I think the issue here is more about we should not raise errors from a node module? because I have no control over it.
This error wont be raised in an older version of vue-tsc
.
Hey there, as there have been many fixes in the last 2.x versions: Please let us know if you're still encountering this issue. Otherwise kindly close this one, thanks!
The first reported error is expected. Expression in @click
is wrapped in a closure, so that the type narrowing won't work, because myState.arrayState
may be changed somewhere else.
The second reported error, I think, is the same as #4249. Let's track it there.
Run
in the following example:
https://stackblitz.com/edit/nuxt-starter-whhd9d?file=package.json
with vue-tsc 2.0.10:
With vue-tsc 2.0.7: No errors
The first error is from this block of code:
In vue-tsc 2.0.10, it raises an error about "myState.arrayState" is possibly undefined, but it is checked by the
v-if
already.The second error comes from a node_module, which should be ignored.
Full error log from vue-tsc 2.0.10: