请稍等 ...
×

采纳答案成功!

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

render error Error: no component matched

启动npm run dev:server报错
浏览器显示:Internal Server Error

> vue-ssr-tech@1.0.0 dev:server F:\vue-demo\vue-ssr-tech
> cross-env NODE_ENV=development node server/server.js

server is listening on 0.0.0.0:3333
new bundle gererated
request with path /
undefined
render error Error: no component matched
    at server-entry.js:465:23
    at F:\vue-demo\vue-ssr-tech\node_modules\vue-router\dist\vue-router.common.js:2081:11
    at Array.forEach (<anonymous>)
    at F:\vue-demo\vue-ssr-tech\node_modules\vue-router\dist\vue-router.common.js:2080:25
    at F:\vue-demo\vue-ssr-tech\node_modules\vue-router\dist\vue-router.common.js:2195:7
    at step (F:\vue-demo\vue-ssr-tech\node_modules\vue-router\dist\vue-router.common.js:1879:7)
    at step (F:\vue-demo\vue-ssr-tech\node_modules\vue-router\dist\vue-router.common.js:1886:9)
    at runQueue (F:\vue-demo\vue-ssr-tech\node_modules\vue-router\dist\vue-router.common.js:1890:3)
    at F:\vue-demo\vue-ssr-tech\node_modules\vue-router\dist\vue-router.common.js:2190:5
    at step (F:\vue-demo\vue-ssr-tech\node_modules\vue-router\dist\vue-router.common.js:1879:7)
Error: no component matched
    at server-entry.js:465:23
    at F:\vue-demo\vue-ssr-tech\node_modules\vue-router\dist\vue-router.common.js:2081:11
    at Array.forEach (<anonymous>)
    at F:\vue-demo\vue-ssr-tech\node_modules\vue-router\dist\vue-router.common.js:2080:25
    at F:\vue-demo\vue-ssr-tech\node_modules\vue-router\dist\vue-router.common.js:2195:7
    at step (F:\vue-demo\vue-ssr-tech\node_modules\vue-router\dist\vue-router.common.js:1879:7)
    at step (F:\vue-demo\vue-ssr-tech\node_modules\vue-router\dist\vue-router.common.js:1886:9)
    at runQueue (F:\vue-demo\vue-ssr-tech\node_modules\vue-router\dist\vue-router.common.js:1890:3)
    at F:\vue-demo\vue-ssr-tech\node_modules\vue-router\dist\vue-router.common.js:2190:5
    at step (F:\vue-demo\vue-ssr-tech\node_modules\vue-router\dist\vue-router.common.js:1879:7)
request with path /favicon.ico
undefined
render error Error: no component matched
    at server-entry.js:465:23
    at AbstractHistory.onReady (F:\vue-demo\vue-ssr-tech\node_modules\vue-router\dist\vue-router.common.js:2049:5)
    at VueRouter.onReady (F:\vue-demo\vue-ssr-tech\node_modules\vue-router\dist\vue-router.common.js:2800:16)
    at server-entry.js:462:12
    at new Promise (<anonymous>)
    at module.exports../client/server-entry.js.exports.default (client/server-entry.js:4:9)
    at F:\vue-demo\vue-ssr-tech\node_modules\vue-server-renderer\build.dev.js:9355:43
    at new Promise (<anonymous>)
    at F:\vue-demo\vue-ssr-tech\node_modules\vue-server-renderer\build.dev.js:9352:14
    at Object.renderToString (F:\vue-demo\vue-ssr-tech\node_modules\vue-server-renderer\build.dev.js:9544:9)
Error: no component matched
    at server-entry.js:465:23
    at AbstractHistory.onReady (F:\vue-demo\vue-ssr-tech\node_modules\vue-router\dist\vue-router.common.js:2049:5)
    at VueRouter.onReady (F:\vue-demo\vue-ssr-tech\node_modules\vue-router\dist\vue-router.common.js:2800:16)
    at server-entry.js:462:12
    at new Promise (<anonymous>)
    at module.exports../client/server-entry.js.exports.default (client/server-entry.js:4:9)
    at F:\vue-demo\vue-ssr-tech\node_modules\vue-server-renderer\build.dev.js:9355:43
    at new Promise (<anonymous>)
    at F:\vue-demo\vue-ssr-tech\node_modules\vue-server-renderer\build.dev.js:9352:14
    at Object.renderToString (F:\vue-demo\vue-ssr-tech\node_modules\vue-server-renderer\build.dev.js:9544:9)

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

1回答

Jokcy 2020-03-01 22:01:55

看起来是 /favicon.ico 的请求被vue处理了,这个请求肯定没有对应的vue路由,所以九出现了这个报错。可以在进入vue路由之前,先把 /favicon.ico 路由拦截处理掉

0 回复 有任何疑惑可以回复我~
  • NeoRRRR #1
    这个请求是在哪调用的?我全局搜索只看到在server.js里定义,没看到哪里调用
    回复 有任何疑惑可以回复我~ 2020-03-02 21:15:36
  • Jokcy 回复 NeoRRRR #2
    这是浏览器默认的,favicon.ico就是你在页面tab上看到的小图标,如果么有提供,默认就是/favicon.ico
    回复 有任何疑惑可以回复我~ 2020-03-04 21:35:03
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信