官方推荐useExtendedLib 扩展库方式引入weui组件失败,完全按照文档来的,缺了什么吗?
发布于 6 年前 作者 xiangjie 6217 次浏览 来自 问答

引入流程:

1、编辑app.json,添加:

"useExtendedLib": {
  "weui"true
}

2、编辑页面的json文件,如下:

{
  "usingComponents": {
    "mp-dialog": "weui-miniprogram/dialog/dialog"
  }
}

3、编辑页面wxml文件,如下:

test content

4、编译报错,异常栈如下:

[渲染层错误] TypeError: Cannot read property 'replace' of undefined
    at rewritor (http://127.0.0.1:56450/__pageframe__/__extendedlib__/weui/latest/pageframe.js:176:44)
    at http://127.0.0.1:56450/__pageframe__/__extendedlib__/weui/latest/pageframe.js:194:127
[渲染层错误] webviewScriptError
Cannot read property 'replace' of undefined
TypeError: Cannot read property 'replace' of undefined
    at rewritor (http://127.0.0.1:56450/__pageframe__/__extendedlib__/weui/latest/pageframe.js:176:44)
    at http://127.0.0.1:56450/__pageframe__/__extendedlib__/weui/latest/pageframe.js:194:127
[渲染层错误] Uncaught TypeError: Cannot read property 'replace' of undefined
[渲染层错误] TypeError: t is not a function
    at _ (http://127.0.0.1:56450/__pageframe__/__dev__/WAWebview.js:19:29802)
    at Function.A [as create] (http://127.0.0.1:56450/__pageframe__/__dev__/WAWebview.js:19:29936)
    at Function.p.prepare (http://127.0.0.1:56450/__pageframe__/__dev__/WAWebview.js:6:14825)
    at Function.p._advancedCreate (http://127.0.0.1:56450/__pageframe__/__dev__/WAWebview.js:6:15474)
    at l.createComponent (http://127.0.0.1:56450/__pageframe__/__dev__/WAWebview.js:6:22629)
    at e.value (http://127.0.0.1:56450/__pageframe__/__dev__/WAWebview.js:20:1882)
    at http://127.0.0.1:56450/__pageframe__/__dev__/WAWebview.js:20:3031
    at Array.forEach ()
    at e.value (http://127.0.0.1:56450/__pageframe__/__dev__/WAWebview.js:20:3003)
    at e.value (http://127.0.0.1:56450/__pageframe__/__dev__/WAWebview.js:19:30482)
[渲染层错误] exparserScriptError
t is not a function
TypeError: t is not a function
    at _ (http://127.0.0.1:56450/__pageframe__/__dev__/WAWebview.js:19:29802)
    at Function.A [as create] (http://127.0.0.1:56450/__pageframe__/__dev__/WAWebview.js:19:29936)
    at Function.p.prepare (http://127.0.0.1:56450/__pageframe__/__dev__/WAWebview.js:6:14825)
    at Function.p._advancedCreate (http://127.0.0.1:56450/__pageframe__/__dev__/WAWebview.js:6:15474)
    at l.createComponent (http://127.0.0.1:56450/__pageframe__/__dev__/WAWebview.js:6:22629)
    at e.value (http://127.0.0.1:56450/__pageframe__/__dev__/WAWebview.js:20:1882)
    at http://127.0.0.1:56450/__pageframe__/__dev__/WAWebview.js:20:3031
    at Array.forEach ()
    at e.value (http://127.0.0.1:56450/__pageframe__/__dev__/WAWebview.js:20:3003)
    at e.value (http://127.0.0.1:56450/__pageframe__/__dev__/WAWebview.js:19:30482)
[渲染层错误] TypeError: Cannot read property 'replace' of undefined
    at rewritor (http://127.0.0.1:56450/__pageframe__/__extendedlib__/weui/latest/pageframe.js:176:44)
    at http://127.0.0.1:56450/__pageframe__/__extendedlib__/weui/latest/pageframe.js:194:127
[渲染层错误] webviewScriptError
Cannot read property 'replace' of undefined
TypeError: Cannot read property 'replace' of undefined
    at rewritor (http://127.0.0.1:56450/__pageframe__/__extendedlib__/weui/latest/pageframe.js:176:44)
    at http://127.0.0.1:56450/__pageframe__/__extendedlib__/weui/latest/pageframe.js:194:127
[渲染层错误] Uncaught TypeError: Cannot read property 'replace' of undefined

是我操作不对还是文档缺失?或者与工具版本有关?我是稳定最新版,版本号为1.03.2011120,已看到有其他人遇到相同问题没有人回复。

1 回复

感谢反馈,我们正在排查中,用户可以先尝试提高基础库版本

回到顶部