-
-
Notifications
You must be signed in to change notification settings - Fork 182
Closed as not planned
Description
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
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.