JZTXT
  • 首页
  • Ai
  • Java
  • Python
  • Android
  • Mysql
  • JavaScript
  • Html
  • CSS

Vue报错 Error in destroyed hook: "TypeError: xxx is not a function”

发布时间 2023-08-30 19:34:23作者: ridiculousknight

问题

将项目npm run build打包以后,进入项目本地文件夹dist,打开index.html,页面空白并且报如下错误

image

解决

中文搜索找到的相关内容都没有解决问题,还是stack overflow稳

vue.js - [Vue warn]: Error in created hook: "TypeError: $ is not a function" - Stack Overflow

所以问题的根源很可能是一个typo(打字错误)

我又仔细看了一遍相关代码,确实是typo,生命周期钩子mounted被我写成了monuted

改正之后,页面正常显示且不再报错

    本栏目推荐文章
  • A connection was successfully established with the server but then an error
  • vscode错误:Unable to connect to VS Code server: Error in request.
  • 【解决方案】Error running,Command line is too long
  • fish和pacman:“error: Unable to read input file: 是一个目录”报错的处理
  • ERROR 2059 (HY000): Authentication plugin 'caching_sha2_password'
  • mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION; ERROR 1410 (42000): You are not allowed to create a user with GRANT
  • "nginx.conf" E514 : write error (file system full?)
  • Flutter 项目运行到ios模拟器报错 : Error (Xcode): SDK does not contain 'libarclite'
  • 解决TypeError: string indices must be integers, not str
  • c++编译OpenSceneGraph-3.4 出现 error: narrowing conversion of ‘-1’ from ‘int’ to ‘char’ inside { } [-Wnarrowing]
版权声明:本网站为非赢利性站点,本网站所有内容均来源于互联网相关站点自动搜索采集信息,相关链接已经注明来源。
联系我们