uni-app Uncaught ReferenceError: process is not defined at app-renderjs.js
uni-app Uncaught ReferenceError: process is not defined at app-renderjs.js
产品分类:uniapp/App
开发环境信息
项目 | 详情 |
---|---|
PC开发环境操作系统 | Windows |
PC开发环境操作系统版本号 | win11 |
HBuilderX类型 | 正式 |
HBuilderX版本号 | 4.45 |
手机系统 | Android |
手机系统版本号 | Android 15 |
手机厂商 | 华为 |
手机机型 | ipad |
页面类型 | vue |
vue版本 | vue2 |
打包方式 | 云端 |
项目创建方式 | HBuilderX |
bug描述
11:46:24.131 Uncaught ReferenceError: process is not defined at app-renderjs.js:54
11:46:25.862 [1736221587340][0ms][renderjs]:"2cd3a838 not found" at uni-app-view.umd.js:7
11:46:25.862 [1736221587341][1ms][wxs]:"module AppIndex not found" at uni-app-view.umd.js:7
11:46:25.862 [1736221587342][1ms][wxs]:"module AppIndex not found" at uni-app-view.umd.js:7
11:46:26.102 Uncaught ReferenceError: process is not defined at app-renderjs.js:54
11:46:26.461 [1736221587936][0ms][renderjs]:"2cd3a838 not found" at uni-app-view.umd.js:7
11:46:26.461 [1736221587936][0ms][wxs]:"module AppIndex not found" at uni-app-view.umd.js:7
11:46:26.461 [1736221587936][0ms][wxs]:"module AppIndex not found" at uni-app-view.umd.js:7
11:46:26.493 output->services, [Object] [{"id":"univerify","description":"一键登录","nativeClient":true,"authResult":null,"userInfo":nu...} at utils/index.js:322
11:46:26.685 Uncaught ReferenceError: process is not defined at app-renderjs.js:54
示例代码
11:46:24.131 Uncaught ReferenceError: process is not defined at app-renderjs.js:54
11:46:25.862 [1736221587340][0ms][renderjs]:"2cd3a838 not found" at uni-app-view.umd.js:7
11:46:25.862 [1736221587341][1ms][wxs]:"module AppIndex not found" at uni-app-view.umd.js:7
11:46:25.862 [1736221587342][1ms][wxs]:"module AppIndex not found" at uni-app-view.umd.js:7
11:46:26.102 Uncaught ReferenceError: process is not defined at app-renderjs.js:54
11:46:26.461 [1736221587936][0ms][renderjs]:"2cd3a838 not found" at uni-app-view.umd.js:7
11:46:26.461 [1736221587936][0ms][wxs]:"module AppIndex not found" at uni-app-view.umd.js:7
11:46:26.461 [1736221587936][0ms][wxs]:"module AppIndex not found" at uni-app-view.umd.js:7
11:46:26.493 output->services, [Object] [{"id":"univerify","description":"一键登录","nativeClient":true,"authResult":null,"userInfo":nu...} at utils/index.js:322
11:46:26.685 Uncaught ReferenceError: process is not defined at app-renderjs.js:54
操作步骤
11:46:24.131 Uncaught ReferenceError: process is not defined at app-renderjs.js:54
11:46:25.862 [1736221587340][0ms][renderjs]:"2cd3a838 not found" at uni-app-view.umd.js:7
11:46:25.862 [1736221587341][1ms][wxs]:"module AppIndex not found" at uni-app-view.umd.js:7
11:46:25.862 [1736221587342][1ms][wxs]:"module AppIndex not found" at uni-app-view.umd.js:7
11:46:26.102 Uncaught ReferenceError: process is not defined at app-renderjs.js:54
11:46:26.461 [1736221587936][0ms][renderjs]:"2cd3a838 not found" at uni-app-view.umd.js:7
11:46:26.461 [1736221587936][0ms][wxs]:"module AppIndex not found" at uni-app-view.umd.js:7
11:46:26.461 [1736221587936][0ms][wxs]:"module AppIndex not found" at uni-app-view.umd.js:7
11:46:26.493 output->services, [Object] [{"id":"univerify","description":"一键登录","nativeClient":true,"authResult":null,"userInfo":nu...} at utils/index.js:322
11:46:26.685 Uncaught ReferenceError: process is not defined at app-renderjs.js:54
预期结果
11:46:24.131 Uncaught ReferenceError: process is not defined at app-renderjs.js:54
11:46:25.862 [1736221587340][0ms][renderjs]:"2cd3a838 not found" at uni-app-view.umd.js:7
11:46:25.862 [1736221587341][1ms][wxs]:"module AppIndex not found" at uni-app-view.umd.js:7
11:46:25.862 [1736221587342][1ms][wxs]:"module AppIndex not found" at uni-app-view.umd.js:7
11:46:26.102 Uncaught ReferenceError: process is not defined at app-renderjs.js:54
11:46:26.461 [1736221587936][0ms][renderjs]:"2cd3a838 not found" at uni-app-view.umd.js:7
11:46:26.461 [1736221587936][0ms][wxs]:"module AppIndex not found" at uni-app-view.umd.js:7
11:46:26.461 [1736221587936][0ms][wxs]:"module AppIndex not found" at uni-app-view.umd.js:7
11:46:26.493 output->services, [Object] [{"id":"univerify","description":"一键登录","nativeClient":true,"authResult":null,"userInfo":nu...} at utils/index.js:322
11:46:26.685 Uncaught ReferenceError: process is not defined at app-renderjs.js:54
实际结果
11:46:24.131 Uncaught ReferenceError: process is not defined at app-renderjs.js:54
11:46:25.862 [1736221587340][0ms][renderjs]:"2cd3a838 not found" at uni-app-view.umd.js:7
11:46:25.862 [1736221587341][1ms][wxs]:"module AppIndex not found" at uni-app-view.umd.js:7
11:46:25.862 [1736221587342][1ms][wxs]:"module AppIndex not found" at uni-app-view.umd.js:7
11:46:26.102 Uncaught ReferenceError: process is not defined at app-renderjs.js:54
11:46:26.461 [1736221587936][0ms][renderjs]:"2cd3a838 not found" at uni-app-view.umd.js:7
11:46:26.461 [1736221587936][0ms][wxs]:"module AppIndex not found" at uni-app-view.umd.js:7
11:46:26.461 [1736221587936][0ms][wxs]:"module AppIndex not found" at uni-app-view.umd.js:7
11:46:26.493 output->services, [Object] [{"id":"univerify","description":"一键登录","nativeClient":true,"authResult":null,"userInfo":nu...} at utils/index.js:322
11:46:26.685 Uncaught ReferenceError: process is not defined at app-renderjs.js:54
4 回复
写了什么代码出现的?提供一个空白工程。看报错是使用了 process 这个 node 的环境变量
定位到问题了,项目是由wap2html过来的,以前就安装了html2canvas依赖,都运行一年了,都从来没有出现这个错,昨天重构就把不要的包html2canvas删除,然后运行就一直报这个错,项目里也没有地方用到它,找遍了没找到,最后没办法,安装这个包又能正常运行了。
回复 b***@qq.com: 可能是 html2canvas 对 process 进行了赋值,你可以搜一下源码,应该是为了兼容 node 和浏览器