g***@163.com
g***@163.com
  • 发布:2019-05-15 15:03
  • 更新:2019-07-11 17:00
  • 阅读:5593

新创建的UNIAPP项目,建立nvue文件一运行就报 $gwx is not a function.

分类:uni-app

新创建的UNIAPP项目,建立nvue文件一运行就报 $gwx is not a function.

刚刚创建的uniapp,添加nvue文件在真机运行就报:
TypeError: $gwx is not a function. (In '$gwx('./app.wxml')', '$gwx' is undefined)file name:app-view.jsline no:115
14:57:42.700 global code@app-view.js:115:31
14:57:42.720 webviewScriptError
14:57:42.721 $gwx is not a function. (In '$gwx('./app.wxml')', '$gwx' is undefined)
14:57:42.721 global code@app-view.js:115:31
14:57:42.741 [JS Framework] Failed to execute the callback function:
14:57:42.741 + TypeError: e is not a function. (In 'e()', 'e' is false) __ERROR

全新的项目,什么都没有,一创建nveu就报这个,请问是BUG,还是创建nuve还要什么步骤???

开发工具:HX 1.9.6.20190515-alpha

2019-05-15 15:03 负责人:无 分享
已邀请:
陈锐

陈锐 - REIGE

同样的这个问题

陈锐

陈锐 - REIGE

新建uni-app 官方示例 真机运行 一样直接报错

15:07:15.343  TypeError: $gwx is not a function  
15:07:15.364 at file:///storage/emulated/0/Android/data/io.dcloud.HBuilder/apps/HBuilder/www/app-view.js:115:27 at uniapp://ready:182  
15:07:15.384  webviewScriptError  
15:07:15.405 $gwx is not a function  
15:07:15.425 TypeError: $gwx is not a function  
15:07:15.445 at file:///storage/emulated/0/Android/data/io.dcloud.HBuilder/apps/HBuilder/www/app-view.js:115:27 at uniapp://ready:182  
15:07:15.466  Uncaught TypeError: $gwx is not a function at app-view.js:115  
15:07:15.486 07:12.098  9157  9180 E console : [ERROR] reportJSException >>>> exception function:createInstance, exception:Exception: TypeError: $gwx is not a function. (In '$gwx('./app.wxml')', '$gwx' is undefined)  
15:07:15.506 07:12.098  9157  9180 E console : (global function):26:31  
15:07:15.527 07:12.098  9157  9180 E console : anonymous@(global function):74215:7  
15:07:15.548 07:12.098  9157  9180 E console : (weex framework):1:41537  
15:07:15.567 07:12.098  9157  9180 E console : createInstance@(weex framework):1:41548  
15:07:15.588 07:12.098  9157  9180 E console : (weex framework):1:178111  
15:07:15.608 07:12.098  9157  9180 E console :  
15:07:15.630 07:12.098  9157  9180 E console :  getTemplateInfo== template md5 c126ef958f1b1fa438adf3be465e8956 length 6629898 base64 md5 wSbvlY8bH6Q4rfO+Rl6JVg== response header {"templateSourceBase64MD5":["wSbvlY8bH6Q4rfO+Rl6JVg=="],"templateSourceMD5":["c126ef958f1b1fa438adf3be465e8956"]}
  • DCloud_UNI_FXY

    你是新建 hello uni-app ,什么都没改,直接运行就报错?

    2019-05-15 17:42

  • g***@163.com (作者)

    回复 DCloud_UNI_FXY: 是的,新建项目,然后建了一个home/home.nvue运行就报错:

    23:44:19.023 TypeError: $gwx is not a function. (In '$gwx('./app.wxml')', '$gwx' is undefined)file name:app-view.jsline no:115

    23:44:19.043 global code@app-view.js:115:31

    23:44:19.063 webviewScriptError

    23:44:19.063 $gwx is not a function. (In '$gwx('./app.wxml')', '$gwx' is undefined)

    23:44:19.063 global code@app-view.js:115:31

    23:44:19.084 [JS Framework] Failed to execute the callback function:

    23:44:19.085 + TypeError: e is not a function. (In 'e()', 'e' is false) __ERROR

    2019-05-15 23:45

  • g***@163.com (作者)

    回复 DCloud_UNI_FXY: 又出现了!!!

    2019-05-15 23:46

  • 小瓶盖1

    回复 g***@163.com: 请问作者解决了吗,同样的问题

    2019-09-23 13:49

DCloud_UNI_FXY

DCloud_UNI_FXY

目前整个工程内如果只有一个页面,且该页面存在同名 nvue,会出现该问题,你可以再新建一个其他 vue 页面临时解决该问题

  • 陈锐

    那我官方demo真机运行一样报这个是什么原因呢,正式版,

    2019-05-15 15:31

  • g***@163.com (作者)

    这个也不能百分百解决这个问题,偶尔也会出来这个BUG的

    2019-05-15 15:42

g***@163.com

g***@163.com (作者) - uni-app 从入门到吐血身亡烧成灰

  • DCloud_UNI_FXY

    参考之前回复的内容:“目前整个工程内如果只有一个页面,且该页面存在同名 nvue,会出现该问题,你可以再新建一个其他 vue 页面临时解决该问题”

    2019-05-17 17:37

  • g***@163.com (作者)

    回复 DCloud_UNI_FXY: 都试过的了,之前我新建了一个home/home.nvue 也一样报错

    2019-05-17 17:50

  • DCloud_UNI_FXY

    回复 g***@163.com: 发测试工程

    2019-05-17 17:51

  • x***@163.com

    回复 DCloud_UNI_FXY:

    这个错误提示,很具误导性;希望彻底解决,或至少给出清晰提示(那个文件出错)。

    2019-07-11 17:03

x***@163.com

x***@163.com - 网络无垠,技术无界,知识无价,生命无悔

!!! 各位我搞定

  • 不过这个错误提示很欠揍!!!

    • 很具有误导性!
  • 原因:

    • 我的pages里面有个测试文件,用来测试h5+css3的;
    • 里面随便写了些:h3, p, ul, li, iframe等标签;
    • 如附件(因为测试,很随便写的啊!);
  • 解决:

    • 删除这个文件;
    • 并从pages.json中注释掉这个文件;
    • 不过要从很多文件中,找到这个(些)文件,可能很麻烦!看你们自己的系统 ...

ps:我的版本是:2.0.1+win7
到此解决!

该问题目前已经被锁定, 无法添加新回复