Uncaught TypeError Cannot read properties of undefined (reading '$') at uni-app-view.umd.js:7

Uncaught TypeError Cannot read properties of undefined (reading ‘$’) at uni-app-view.umd.js:7

开发环境 版本号 项目创建方式
Windows win10 HBuilderX
产品分类:uniapp/App

PC开发环境操作系统:Windows

手机系统:Android

手机系统版本号:Android 14

手机厂商:vivo

手机机型:iqoo neo9

页面类型:vue

vue版本:vue3

打包方式:离线

### 操作步骤:
<p>Uncaught TypeError: Cannot read properties of undefined (reading '$') at uni-app-view.umd.js:7</p>

### 实际结果:
<p>Uncaught TypeError: Cannot read properties of undefined (reading '$') at uni-app-view.umd.js:7</p>

### bug描述:
<p>Uncaught TypeError: Cannot read properties of undefined (reading '$') at uni-app-view.umd.js:7</p>

更多关于Uncaught TypeError Cannot read properties of undefined (reading '$') at uni-app-view.umd.js:7的实战教程也可以访问 https://www.itying.com/category-93-b0.html

4 回复

能提供更多复现信息吗?比如做了什么操作页面开始报错了,页面状态等等

更多关于Uncaught TypeError Cannot read properties of undefined (reading '$') at uni-app-view.umd.js:7的实战教程也可以访问 https://www.itying.com/category-93-b0.html


你好,我执行了uni.navigateTo,跳转到新页面后出现这个报错,但没有影响运行。我有把跳转的page改为其他正常的page,条状后也会出现这个报错,手机上运行没有任何问题,只是uniapp终端中出现这个报错

已解决,是因为使用了组件的ucharts,改为原生方法就好了

这个错误通常是由于Vue实例未正确初始化导致的。以下是可能的原因和解决方案:

  1. 最常见的原因是Vue3项目中没有正确设置Vue实例。请检查main.js文件是否包含以下内容:
import { createSSRApp } from 'vue'
import App from './App.vue'

export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
  1. 检查是否使用了不兼容的插件或组件,某些Vue2插件在Vue3中会报这个错误。

  2. 确保所有自定义组件都正确注册,特别是在使用setup语法糖时。

  3. 如果是页面跳转时出现的错误,检查目标页面是否正确导出了Vue组件。

  4. 尝试清理项目并重新安装依赖:

rm -rf node_modules
npm install
回到顶部