惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

W
WeLiveSecurity
The GitHub Blog
The GitHub Blog
Engineering at Meta
Engineering at Meta
Microsoft Azure Blog
Microsoft Azure Blog
The Register - Security
The Register - Security
Stack Overflow Blog
Stack Overflow Blog
博客园 - 三生石上(FineUI控件)
T
Threat Research - Cisco Blogs
S
SegmentFault 最新的问题
V2EX - 技术
V2EX - 技术
Hacker News: Ask HN
Hacker News: Ask HN
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
P
Proofpoint News Feed
J
Java Code Geeks
Microsoft Security Blog
Microsoft Security Blog
M
MIT News - Artificial intelligence
AI
AI
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Proofpoint News Feed
Hacker News - Newest:
Hacker News - Newest: "LLM"
B
Blog
N
News and Events Feed by Topic
N
News | PayPal Newsroom
Google DeepMind News
Google DeepMind News
酷 壳 – CoolShell
酷 壳 – CoolShell
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
WordPress大学
WordPress大学
C
Cybersecurity and Infrastructure Security Agency CISA
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 【当耐特】
U
Unit 42
腾讯CDC
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
The Cloudflare Blog
H
Help Net Security
Recent Announcements
Recent Announcements
P
Privacy & Cybersecurity Law Blog
IT之家
IT之家
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Security Archives - TechRepublic
Security Archives - TechRepublic
L
LINUX DO - 热门话题
Martin Fowler
Martin Fowler
MongoDB | Blog
MongoDB | Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
H
Heimdal Security Blog
博客园 - 聂微东
S
Securelist
大猫的无限游戏
大猫的无限游戏
Cloudbric
Cloudbric
Cisco Talos Blog
Cisco Talos Blog

Vite

vite 通过局域网或者端口转发进行访问时特别慢。 - V2EX vite+vue3 有什么插件可以让编译后的 js 被加密保护吗。类似 jsjiami.com 那样 - V2EX vite 有什么插件会把 unicode 转成中文吗 - V2EX 请教: vite + electron.js + vue.js 3 开发桌面软件,无法在 renderer 中加载 C++ node module - V2EX 请教一个 vite 代理的问题 - V2EX 请问各位大佬一个 vite 插件的问题 - V2EX vite 设置生产环境 baseURL 为 /api/,真实请求会自动添加本机 ip 地址吗 - V2EX Vite 执行 build 时如何能够自动添加其他文件到 dist 文件夹? - V2EX element plus 按钮的问题,求帮助 - V2EX 问下前端大佬,VITE+ESLINT+VSCODE 在 编译阶段 不报错怎么解决? - V2EX Vite + React + Ant Design + Tailwind CSS + ESLint + Prettier + TypeScript 最佳实践 - V2EX vite+vue3+ts 自己搭建时候一些步骤及踩坑分享 - V2EX How to use Vite to build all kinds of TypeScript projects, including CSR/SSR/CDN/MonoRepository - V2EX 请问能否通过 vite 插件功能去修改项目中某一个文件的内容或者获取文件内容? - V2EX vite 应该怎么学? - V2EX Vite+React+TS+Eslint+Prettier starter kit - V2EX VitePress 如何创建自定义的 UI 主题 - V2EX
vite 打包后,好好的功能报错了?有没有懂 vite 打包原理的大佬,求解一下 - V2EX
devilte · 2021-11-17 · via Vite

这是一个创建于 1670 天前的主题,其中的信息可能已经有所发展或是发生改变。

前端项目,技术栈是 Vue3.x + Vite + TypeScript

本地运行起来的一切正常,打包上线后,控制台报了错误:

TypeError: Right-hand side of 'instanceof' is not an object

调试之后发现,打包后的源码里,一个 instanceof 方法的左边是一个 div 元素对象,这个 div 对象是用来绑定画布用的容器,代码中如下:

 template:
<div class="graph" ref="graphRef" id="graphRef"></div>

script:
const graphRef = ref<HTMLElement | null>(null);

报错位置代码如下,图上的这些代码并不是写在项目里的,应该是打包后注入进去的: I4YiC9.png

现在问题就是不知道 打包后的这些方法使用逻辑是什么?怎么解决这个报错呢?求解

第 2 条附言  ·  2021 年 11 月 17 日

后续:

知道Backbone有用到jQuery,那这个$应该就是jQuery了,然后手动在项目里安装了jQueryBackbone,然后在入口文件的地方,先手动给Backbone绑定了一下$,果然可以了~

虽然线上的问题暂时是解决了。但是目前为止,我还是不知道为什么打包后,会把Backbone.$给打包没了,希望后面有知道原理的大佬给指点一下,万分感谢。