You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
EN: When using Script Setup syntactic sugar, importing a TS interface or type definition will result in a warning
ZH: 当使用Script Setup语法糖时,导入一个TS接口或类型定义会报一个警告
EN: When I import a type that comes with Vue or an interface I wrote (not shown here, of course), I get a warning that my route matches the current component, but there's a problem with the import chain, so the page goes blank
EN: But I prepended the type marker and the error no longer exists.
ZH: 不过我在前面加上type标识,这个错误就不复存在。
EN: Also when I modify this part of the code by removing the type or adding the type logo, the following happens with hot substitution.
ZH: 另外我在修改这部分代码时,删除type或加上type标识,热替换(HMR)出现以下情况:
EN: So to narrow it down, my guess: it may be that when recognizing the imported packages, the components and types are not correctly distinguished, resulting in module parsing failure.
EN: I tried to reproduce it in codesandbox, but there is no such problem. It seems that this Bug exists by chance, maybe it is a problem of my project.
Describe the bug
EN: When using
Script Setup
syntactic sugar, importing aTS
interface or type definition will result in a warningZH: 当使用
Script Setup
语法糖时,导入一个TS
接口或类型定义会报一个警告EN: When I import a type that comes with
Vue
or an interface I wrote (not shown here, of course), I get a warning that my route matches the current component, but there's a problem with the import chain, so the page goes blankZH: 当我导入
Vue
自带的类型或者自己写的接口(当然这里没有展示)时,会报警告,我的路由匹配的就是当前这个组件,不过在导入链出现了问题,所以页面一片空白EN: But I prepended the
type
marker and the error no longer exists.ZH: 不过我在前面加上
type
标识,这个错误就不复存在。EN: Also when I modify this part of the code by removing the
type
or adding thetype
logo, the following happens with hot substitution.ZH: 另外我在修改这部分代码时,删除
type
或加上type
标识,热替换(HMR
)出现以下情况:EN: So to narrow it down, my guess: it may be that when recognizing the imported packages, the components and types are not correctly distinguished, resulting in module parsing failure.
ZH: 所以范围缩小,我的猜测:可能是在识別导入的包的时候,没有正确区分出组件与类型,导致模块解析失败。
Reproduction
EN: I tried to reproduce it in
codesandbox
, but there is no such problem. It seems that thisBug
exists by chance, maybe it is a problem of my project.ZH: 我尝试在
codesandbox
复现它,但是却没有这个问题,貌似这个Bug
存在偶然性,也许是我项目的问题。System Info
vite
version: v1.0.0-rc.13vue
version (fromyarn.lock
orpackage-lock.json
): 3.0.4@vue/compiler-sfc
version: 3.0.4Logs (Optional if provided reproduction)
vite
orvite build
with the--debug
flag.ImageLink: https://s3.ax1x.com/2020/12/28/rThbEd.png / https://imgchr.com/i/rThbEd
The text was updated successfully, but these errors were encountered: