Skip to content
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

vite+vue3+ts项目中,.vue文件内的TS不报错! #467

Closed
7 of 9 tasks
bestime opened this issue Nov 2, 2024 · 2 comments
Closed
7 of 9 tasks

vite+vue3+ts项目中,.vue文件内的TS不报错! #467

bestime opened this issue Nov 2, 2024 · 2 comments

Comments

@bestime
Copy link

bestime commented Nov 2, 2024

Related plugins

Describe the bug

有这么一段代码,编译不会报错,奇葩的是,运行时浏览器不报错,必须要try catch才行。

// 这个数据可能从一个未知的地方来(来源不重要)
const a:any = {}
console.log(a.b.c.d.e.f.g)

然而这个项目也许是别人的,又或许数据来源变了,导致数据结构发生了变化,项目中又有多处这种潜在问题,又无法一一排查,如何能让这个代码在浏览器中直接抛错(试了js、和非vue文件引用的TS浏览器会抛错)而且本来也应该抛错

Reproduction

Steps to reproduce

System Info

普通浏览器

Used Package Manager

npm

Logs

npm run dev

Validations

@edison1105
Copy link
Member

只有一个代码片段,我们是没办法排查问题的。请提供完整的复现 demo。

Copy link

github-actions bot commented Nov 4, 2024

Hello @bestime. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with need reproduction will be closed if they have no activity within 3 days.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 8, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Nov 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants