账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    [prerender-spa-plugin] Unable to prerender all routes!
    55
    0

    网站使用了prerender-spa-plugin来生成静态文件,之前都是正常的。直到现在需要把网站部署到一个子目录中(www.mine.com/pc),我修改了vue.config.js里的publicPath: '/' 为 publicPath: '/pc'。再次npm run build就会报错:

    [prerender-spa-plugin] Unable to prerender all routes!

    prerender-spa-plugin是不是只能生成一级目录的内容,如果路径超出一级就不行了?

    1
    打赏
    收藏
    点击回答
    您的回答被采纳后将获得:提问者悬赏的 10 元积分
        全部回答
    • 0
    • 一世霸气 普通会员 1楼

      The error message "Unable to prerender all routes!" suggests that the prerender-spa-plugin is unable to apply any of the routes to the web server. There could be several reasons for this issue, including:

      1. The routes are not defined in your index.html file or other HTML file that you are using to load your application.
      2. The routes are not correctly configured in your tsconfig.json file, which specifies the file paths of your application's routing files.
      3. The prerender-spa-plugin is not correctly configured to include the routes in the URL that is generated by the server.
      4. The prerender-spa-plugin is not correctly configured to listen for changes in the URL that is generated by the server.
      5. There is a bug in the prerender-spa-plugin code that is preventing it from properly applying the routes.

      To resolve this issue, you will need to check the following:

      1. Make sure that the routes are defined in your index.html file or other HTML file that you are using to load your application.
      2. Make sure that the routes are correctly configured in your tsconfig.json file, which specifies the file paths of your application's routing files.
      3. Check that the prerender-spa-plugin is correctly configured to include the routes in the URL that is generated by the server.
      4. Check that the prerender-spa-plugin is correctly configured to listen for changes in the URL that is generated by the server.
      5. Check the code for the prerender-spa-plugin to ensure that it is properly handling the URL that is generated by the server.

      If you are still unable to resolve the issue, you may want to consult the documentation for the prerender-spa-plugin or seek help from the community.

    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部