这个报错从何而来呢?用了$u之后小程序页面不显示了,只显示下tab栏,点击tab栏出现该tab的页面没有注册。
来源:6-4 uview中请求封装源码解读与全局配置
慕侠3297407
2022-11-16 15:40:43
[system] WeChatLib: 2.27.0 (2022.10.24 14:49:39) WAServiceMainContext.js?t=wechat&s=1668582181329&v=2.27.0:1 [system] No. of subpackages: 1 WAServiceMainContext.js?t=wechat&s=1668582181329&v=2.27.0:1 [system] LazyCodeLoading: false WAServiceMainContext.js?t=wechat&s=1668582181329&v=2.27.0:1 Uncaught (in promise) undefined(env: Windows,mp,1.06.2209070; lib: 2.27.0) (anonymous) @ WAServiceMainContext.js?t=wechat&s=1668582181329&v=2.27.0:1 _privEmit @ WAServiceMainContext.js?t=wechat&s=1668582181329&v=2.27.0:1 emit @ WAServiceMainContext.js?t=wechat&s=1668582181329&v=2.27.0:1 Re @ WAServiceMainContext.js?t=wechat&s=1668582181329&v=2.27.0:1 Ve @ WAServiceMainContext.js?t=wechat&s=1668582181329&v=2.27.0:1 (anonymous) @ WAServiceMainContext.js?t=wechat&s=1668582181329&v=2.27.0:1 emit @ WAServiceMainContext.js?t=wechat&s=1668582181329&v=2.27.0:1 c @ VM16 asdebug.js:10 __unblock @ VM16 asdebug.js:10 handleWxConfigReady @ VM16 asdebug.js:10 (anonymous) @ VM1769:10 Promise.then (async) (anonymous) @ VM1769:5 loadScripts @ assubloader.js:1 (anonymous) @ assubloader.js:1 e @ assubloader.js:1 (anonymous) @ assubloader.js:1 Promise.then (async) e @ assubloader.js:1 (anonymous) @ assubloader.js:1 Promise.then (async) e @ assubloader.js:1 (anonymous) @ assubloader.js:1 Promise.then (async) e @ assubloader.js:1 (anonymous) @ assubloader.js:1 Promise.then (async) e @ assubloader.js:1 proceedAsyncTasks @ assubloader.js:1 submitSerialAsyncTasks @ assubloader.js:1 (anonymous) @ VM1755:2 t.loadScripts @ VM16 asdebug.js:10 loadAppService @ VM16 asdebug.js:10 messagerCallback @ VM16 asdebug.js:10 (anonymous) @ VM16 asdebug.js:1 f @ VM16 asdebug.js:1 g @ VM16 asdebug.js:1 (anonymous) @ VM16 asdebug.js:1 _ws.onmessage @ VM16 asdebug.js:1 vendor.js?t=wechat&s=1668582181329&v=91ffde9f99751e0e60a5dbb5e1f58834:15072 uView V2.0.34 https://www.uviewui.com/ VM1826:9 app.js错误: TypeError: f is not a function at Request.setConfig (vendor.js?t=wechat&s=1668582181329&v=91ffde9f99751e0e60a5dbb5e1f58834:9575) at Object.<anonymous> (main.js?t=wechat&s=1668582181329&v=af0846f8d6e1cfa42b36b9dbcf792fe3:20) at Object.<anonymous> (main.js?t=wechat&s=1668582181329&v=af0846f8d6e1cfa42b36b9dbcf792fe3:32) at __webpack_require__ (runtime.js?t=wechat&s=1668582181329&v=cc1d6d62151295ea1de64697f3bedcb9:92) at checkDeferredModules (runtime.js?t=wechat&s=1668582181329&v=cc1d6d62151295ea1de64697f3bedcb9:48) at Array.webpackJsonpCallback [as push] (runtime.js?t=wechat&s=1668582181329&v=cc1d6d62151295ea1de64697f3bedcb9:35) at main.js?t=wechat&s=1668582181329&v=af0846f8d6e1cfa42b36b9dbcf792fe3:1 at S (WASubContext.js?t=wechat&s=1668582181329&v=2.27.0:1) at n (WASubContext.js?t=wechat&s=1668582181329&v=2.27.0:1) at app.js?t=wechat&s=1668582181329&v=09c113afbb319b96b85500b8ce2fced4:4(env: Windows,mp,1.06.2209070; lib: 2.27.0) (anonymous) @ VM1826:9 doWhenAllScriptLoaded @ VM1809:1817 scriptLoaded @ VM1809:1845 (anonymous) @ VM1809:1870 Promise.then (async) (anonymous) @ VM1809:1891 (anonymous) @ VM1809:1895 loadScripts @ assubloader.js:1 async function (async) loadScripts @ assubloader.js:1 loadAppResourceScripts @ assubloader.js:1 (anonymous) @ app-service.js:1 WAServiceMainContext.js?t=wechat&s=1668582181329&v=2.27.0:1 TypeError: f is not a function at Request.setConfig (vendor.js?t=wechat&s=1668582181329&v=91ffde9f99751e0e60a5dbb5e1f58834:9575) at Object.<anonymous> (main.js?t=wechat&s=1668582181329&v=af0846f8d6e1cfa42b36b9dbcf792fe3:20) at Object.<anonymous> (main.js?t=wechat&s=1668582181329&v=af0846f8d6e1cfa42b36b9dbcf792fe3:32) at __webpack_require__ (runtime.js?t=wechat&s=1668582181329&v=cc1d6d62151295ea1de64697f3bedcb9:92) at checkDeferredModules (runtime.js?t=wechat&s=1668582181329&v=cc1d6d62151295ea1de64697f3bedcb9:48) at Array.webpackJsonpCallback [as push] (runtime.js?t=wechat&s=1668582181329&v=cc1d6d62151295ea1de64697f3bedcb9:35) at main.js?t=wechat&s=1668582181329&v=af0846f8d6e1cfa42b36b9dbcf792fe3:1 at S (WASubContext.js?t=wechat&s=1668582181329&v=2.27.0:1) at n (WASubContext.js?t=wechat&s=1668582181329&v=2.27.0:1) at app.js?t=wechat&s=1668582181329&v=09c113afbb319b96b85500b8ce2fced4:4(env: Windows,mp,1.06.2209070; lib: 2.27.0) errorReport @ WAServiceMainContext.js?t=wechat&s=1668582181329&v=2.27.0:1 thirdErrorReport @ WAServiceMainContext.js?t=wechat&s=1668582181329&v=2.27.0:1 (anonymous) @ WAServiceMainContext.js?t=wechat&s=1668582181329&v=2.27.0:1 a @ WASubContext.js?t=wechat&s=1668582181329&v=2.27.0:1 (anonymous) @ WASubContext.js?t=wechat&s=1668582181329&v=2.27.0:1 _privEmit @ WASubContext.js?t=wechat&s=1668582181329&v=2.27.0:1 emit @ WASubContext.js?t=wechat&s=1668582181329&v=2.27.0:1 (anonymous) @ WASubContext.js?t=wechat&s=1668582181329&v=2.27.0:1 De @ WASubContext.js?t=wechat&s=1668582181329&v=2.27.0:1 (anonymous) @ WASubContext.js?t=wechat&s=1668582181329&v=2.27.0:1 De @ WASubContext.js?t=wechat&s=1668582181329&v=2.27.0:1 onLoad @ WASubContext.js?t=wechat&s=1668582181329&v=2.27.0:1 ne @ WASubContext.js?t=wechat&s=1668582181329&v=2.27.0:1 (anonymous) @ WASubContext.js?t=wechat&s=1668582181329&v=2.27.0:1 doWhenAllScriptLoaded @ VM1809:1817 scriptLoaded @ VM1809:1845 (anonymous) @ VM1809:1870 error (async) (anonymous) @ WASubContext.js?t=wechat&s=1668582181329&v=2.27.0:1 (anonymous) @ WASubContext.js?t=wechat&s=1668582181329&v=2.27.0:1 (anonymous) @ WASubContext.js?t=wechat&s=1668582181329&v=2.27.0:1 (anonymous) @ WASubContext.js?t=wechat&s=1668582181329&v=2.27.0:1 DevTools failed to load SourceMap: Could not load content for http://127.0.0.1:18329/.sourcemap/mp-weixin/common/main.js.map: HTTP error: status code 403, net::ERR_HTTP_RESPONSE_CODE_FAILURE DevTools failed to load SourceMap: Could not load content for http://127.0.0.1:18329/.sourcemap/mp-weixin/common/runtime.js.map: HTTP error: status code 403, net::ERR_HTTP_RESPONSE_CODE_FAILURE WASubContext.js?t=wechat&s=1668582181329&v=2.27.0:1 Page "pages/home/index" has not been registered yet. DevTools failed to load SourceMap: Could not load content for http://127.0.0.1:18329/.sourcemap/mp-weixin/components/search/search.js.map: HTTP error: status code 403, net::ERR_HTTP_RESPONSE_CODE_FAILURE DevTools failed to load SourceMap: Could not load content for http://127.0.0.1:18329/.sourcemap/mp-weixin/uni_modules/uni-tag/components/uni-tag/uni-tag.js.map: HTTP error: status code 403, net::ERR_HTTP_RESPONSE_CODE_FAILURE DevTools failed to load SourceMap: Could not load content for http://127.0.0.1:18329/.sourcemap/mp-weixin/node-modules/uview-ui/components/u-search/u-search.js.map: HTTP error: status code 403, net::ERR_HTTP_RESPONSE_CODE_FAILURE DevTools failed to load SourceMap: Could not load content for http://127.0.0.1:18329/.sourcemap/mp-weixin/node-modules/uview-ui/components/u-image/u-image.js.map: HTTP error: status code 403, net::ERR_HTTP_RESPONSE_CODE_FAILURE DevTools failed to load SourceMap: Could not load content for http://127.0.0.1:18329/.sourcemap/mp-weixin/node-modules/uview-ui/components/u-badge/u-badge.js.map: HTTP error: status code 403, net::ERR_HTTP_RESPONSE_CODE_FAILURE DevTools failed to load SourceMap: Could not load content for http://127.0.0.1:18329/.sourcemap/mp-weixin/node-modules/uview-ui/components/u-tabs/u-tabs.js.map: HTTP error: status code 403, net::ERR_HTTP_RESPONSE_CODE_FAILURE DevTools failed to load SourceMap: Could not load content for http://127.0.0.1:18329/.sourcemap/mp-weixin/node-modules/uview-ui/components/u-icon/u-icon.js.map: HTTP error: status code 403, net::ERR_HTTP_RESPONSE_CODE_FAILURE DevTools failed to load SourceMap: Could not load content for http://127.0.0.1:18329/.sourcemap/mp-weixin/node-modules/uview-ui/components/u-transition/u-transition.js.map: HTTP error: status code 403, net::ERR_HTTP_RESPONSE_CODE_FAILURE DevTools failed to load SourceMap: Could not load content for http://127.0.0.1:18329/.sourcemap/mp-weixin/common/vendor.js.map: HTTP error: status code 403, net::ERR_HTTP_RESPONSE_CODE_FAILURE DevTools failed to load SourceMap: Could not load content for http://127.0.0.1:18329/.sourcemap/mp-weixin/pages/home/index.js.map: HTTP error: status code 403, net::ERR_HTTP_RESPONSE_CODE_FAILURE DevTools failed to load SourceMap: Could not load content for http://127.0.0.1:18329/.sourcemap/mp-weixin/pages/center/index.js.map: HTTP error: status code 403, net::ERR_HTTP_RESPONSE_CODE_FAILURE DevTools failed to load SourceMap: Could not load content for http://127.0.0.1:18329/.sourcemap/mp-weixin/pages/msg/index.js.map: HTTP error: status code 403, net::ERR_HTTP_RESPONSE_CODE_FAILURE DevTools failed to load SourceMap: Could not load content for http://127.0.0.1:18329/.sourcemap/mp-weixin/pages/hot/index.js.map: HTTP error: status code 403, net::ERR_HTTP_RESPONSE_CODE_FAILURE WAServiceMainContext.js?t=wechat&s=1668582181329&v=2.27.0:1 [system] Launch Time: 1948 ms [JS 文件编译错误] 以下文件体积超过 500KB,已跳过压缩以及 ES6 转 ES5 的处理。 common/vendor.js
<script>
export default {
components: {},
data:()=>({
list:
[{
key: '',
name:'首页'
}, {
key: 'ask',
name:'提问'
}, {
key: 'share',
name:'分享'
},{
key: 'discuss',
name:'讨论'
},{
key: 'advise',
name:'建议'
},{
key: 'notice',
name:'公告'
},{
key: 'logs',
name:'动态'
}],
current:0,
offsetTop:50
}),
methods:{
handle(){
uni.navigateTo({
url:"/subcom-pkg/search/search"
})
},
click(e) {
this.current=e.index
},
async test(){
console.log(this.$u)
}
},1回答
Brian
2022-11-16
大概率 是uview-ui的版本问题,请使用uview-ui@1的版本,
yarn add uview-ui@1
相似问题