Giter Club home page Giter Club logo

Comments (6)

jiangteng2019 avatar jiangteng2019 commented on September 3, 2024

有可能,建议使用高版本的nodejs打包试一下。

from satellite-track.

mynameisasa avatar mynameisasa commented on September 3, 2024

能告知一下您那边使用的版本吗,我现在本地用的是V18.17.0这个版本的。

from satellite-track.

jiangteng2019 avatar jiangteng2019 commented on September 3, 2024

我本地使用的是 v16.14.0。如果你的开发环境是正常的,看报错应该是打包之后的路径问题。可以检查一下资源引用的路径。

from satellite-track.

mynameisasa avatar mynameisasa commented on September 3, 2024

昨晚上又试了T.T,把router/index.js里面的history 模式改了createWebHistory 和createWebHashHistory ,都还是有出现这个问题,或者还需要注意修改其他地方的文件吗
nginx里面的配置是这样的
listen 5173;
server_name 10.71.2.100;
location / {
root html;
index index.html index.htm;
try_files $uri $uri/ /index.html; # 防止页面刷新404
autoindex on;
}

from satellite-track.

jiangteng2019 avatar jiangteng2019 commented on September 3, 2024

这是线上部署的nginx配置。但你的看起来没什么问题。
image

from satellite-track.

jiangteng2019 avatar jiangteng2019 commented on September 3, 2024

如果你的项目没有放在nginx的根目录下,需要在项目中配置公共基础路径,并且要与线上环境保持统一。

from satellite-track.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.