请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

npm start 报错:render error TypeError: Cannot read property 'call' of undefined

https://img1.sycdn.imooc.com//szimg/5b69584b0001f42112140860.jpg

在这里打印的错误

https://img1.sycdn.imooc.com//szimg/5b6958a800010bec07520630.jpg


以下是包版本信息,webpack 4.0的,之前遇到的问题都解决了,但是服务器渲染折腾我好久了,求各位大神指点

"vue": "^2.5.17",

"vue-meta": "^1.5.2",

"vue-router": "^3.0.1",

"vue-server-renderer": "^2.5.17",

"vuex": "^3.0.1"

"webpack": "^4.16.3",

"webpack-cli": "^3.1.0",

"webpack-dev-server": "^3.1.5",

"webpack-merge": "^4.1.3"


正在回答 回答被采纳积分+3

8回答

慕工程2267832 2020-09-16 17:29:28

同问啊

0 回复 有任何疑惑可以回复我~
qq_我的天空_6 2019-05-24 10:17:47

"dependencies": {

"axios": "^0.17.1",

"ejs": "^2.5.7",

"koa": "^2.4.1",

"koa-body": "^2.5.0",

"koa-router": "^7.4.0",

"koa-send": "^4.1.2",

"koa-session": "^5.8.1",

"sha1": "^1.1.1",

"vue": "2.5.13",

"vue-meta": "^1.4.3",

"vue-router": "^3.0.1",

"vue-server-renderer": "^2.5.13",

"vuex": "^3.0.1"

},

"devDependencies": {

"autoprefixer": "7.2.3",

"babel-core": "6.26.0",

"babel-eslint": "^8.2.1",

"babel-helper-vue-jsx-merge-props": "2.0.3",

"babel-loader": "7.1.2",

"babel-plugin-syntax-dynamic-import": "^6.18.0",

"babel-plugin-syntax-jsx": "6.18.0",

"babel-plugin-transform-vue-jsx": "3.5.0",

"babel-preset-env": "1.6.1",

"babel-preset-stage-1": "^6.24.1",

"concurrently": "^3.5.1",

"cross-env": "5.1.3",

"css-loader": "0.28.7",

"eslint": "^4.16.0",

"eslint-config-standard": "^11.0.0-beta.0",

"eslint-loader": "^1.9.0",

"eslint-plugin-html": "^4.0.1",

"eslint-plugin-import": "^2.8.0",

"eslint-plugin-node": "^5.2.1",

"eslint-plugin-promise": "^3.6.0",

"eslint-plugin-standard": "^3.0.1",

"extract-text-webpack-plugin": "3.0.2",

"file-loader": "1.1.6",

"html-webpack-plugin": "2.30.1",

"husky": "^0.14.3",

"memory-fs": "^0.4.1",

"nodemon": "^1.14.12",

"postcss-loader": "2.0.9",

"qiniu": "^7.1.2",

"rimraf": "^2.6.2",

"style-loader": "0.19.1",

"stylus": "0.54.5",

"stylus-loader": "3.0.1",

"url-loader": "0.6.2",

"vue-loader": "13.6.0",

"vue-style-loader": "^3.0.3",

"vue-template-compiler": "2.5.13",

"webpack": "3.10.0",

"webpack-dev-server": "2.9.7",

"webpack-merge": "^4.1.1"

}


我也遇到了这个问题,这个是老师的代码    估计是配置版本的问题,我用老师这个配置就可以了

0 回复 有任何疑惑可以回复我~

你解决了吗?我也遇到这个问题,卡了好久,现在还不知道怎么解决

0 回复 有任何疑惑可以回复我~
桂花糕 2019-03-20 16:14:13

找了半小时,终于知道为什么报错了,因为mpvue运行时会生成一个dist文件夹,小程序是通过识别这个文件夹里的代码运行的,假如你开发时删除了pages文件夹里的某个页面(之前路由配置过,但现在路由里没有的),就会报这个错,解决办法就是删除dist文件夹,重新运行npm start自动生成。

0 回复 有任何疑惑可以回复我~
qq_mk3_0 2018-12-18 20:42:51

请问这个问题解决了吗?我也是报一样的错。

0 回复 有任何疑惑可以回复我~
提问者 beckham7 2018-08-20 10:48:40

https://img1.sycdn.imooc.com//szimg/5b7a2be10001575b12800463.jpg


(准确的说是npm start正常 然后访问3333端口报错,如图)

0 回复 有任何疑惑可以回复我~
  • 请问下 解决了嘛 这个问题
    回复 有任何疑惑可以回复我~ 2018-08-31 14:36:38
提问者 beckham7 2018-08-20 10:48:24

https://img1.sycdn.imooc.com//szimg/5b7a2be10001575b12800463.jpg


(准确的说是npm start正常 然后访问3333端口报错,如图)

0 回复 有任何疑惑可以回复我~
Jokcy 2018-08-09 22:43:01

render部分的代码贴出来

0 回复 有任何疑惑可以回复我~
  • 提问者 beckham7 #1
    ​https://gitee.com/jayitachi/vue-ssr-tech
    代码我都放这里了,麻烦了~
    准确的说是npm start正常 然后访问3333端口报错,如最后一张截图
    回复 有任何疑惑可以回复我~ 2018-08-20 10:46:19
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信