一个有点冷门的错误
vue-cli server运行时没有问题但是访问http://localhost:8080/时报错

URIError: Failed to decode param 'https://blog.cdn.rayfalling.com/%3C%=%20BASE_URL%20%%3Efavicon.ico'
    at decodeURIComponent (<anonymous>)
    at decode_param (J:\xkxt-reloaded-frontend\node_modules\express\lib\router\layer.js:172:12)
    at Layer.match (J:\xkxt-reloaded-frontend\node_modules\express\lib\router\layer.js:123:27)
    at matchLayer (J:\xkxt-reloaded-frontend\node_modules\express\lib\router\index.js:574:18)
    at next (J:\xkxt-reloaded-frontend\node_modules\express\lib\router\index.js:220:15)
    at expressInit (J:\xkxt-reloaded-frontend\node_modules\express\lib\middleware\init.js:40:5)
    at Layer.handle [as handle_request] (J:\xkxt-reloaded-frontend\node_modules\express\lib\router\layer.js:95:5)
    at trim_prefix (J:\xkxt-reloaded-frontend\node_modules\express\lib\router\index.js:317:13)
    at J:\xkxt-reloaded-frontend\node_modules\express\lib\router\index.js:284:7
    at Function.process_params (J:\xkxt-reloaded-frontend\node_modules\express\lib\router\index.js:335:12)
    at next (J:\xkxt-reloaded-frontend\node_modules\express\lib\router\index.js:275:10)
    at query (J:\xkxt-reloaded-frontend\node_modules\express\lib\middleware\query.js:45:5)
    at Layer.handle [as handle_request] (J:\xkxt-reloaded-frontend\node_modules\express\lib\router\layer.js:95:5)
    at trim_prefix (J:\xkxt-reloaded-frontend\node_modules\express\lib\router\index.js:317:13)
    at J:\xkxt-reloaded-frontend\node_modules\express\lib\router\index.js:284:7
    at Function.process_params (J:\xkxt-reloaded-frontend\node_modules\express\lib\router\index.js:335:12)

检查后发现是根目录匹配的页面是index.html但是我在vue.config.js中配置的多页设置没有导出index.html
导致EJS在模板编译的时候匹配失败。

解决方案

pages中保证至少有一个输出的是index.html

说点什么
支持Markdown语法
在"VUE CLI报错 Failed to decode param ‘/%3C%=%20BASE_URL%20%%3"已有1条评论
Loading...