已解决
浏览器控制台报错Failed to load module script:解决方法
来自网友在路上 196896提问 提问时间:2023-11-08 09:47:24阅读次数: 96
最佳答案 问答题库968位专家为你答疑解惑
浏览器控制台报错Failed to load module script:解决方法
在vue项目打包上传至服务器出现的报错。因为nginx转发路径问题,记录一下:
原本nginx直指向了一个前端项目,后来又加了一个,就直接复制的上一次的,导致变量名重复报的错
// 原来错误的代码,@router 变量名错误
location ^~/visitor/ {try_files $uri $uri/ @router;alias /nsfocus/local/nginx/html/visitor/;index index.html;
}
location @router{rewrite ^.*$ /visitor/index.html last;
}location ^~/seats/ {try_files $uri $uri/ @router;alias /nsfocus/local/nginx/html/seats/;index index.html;
}
location @router{rewrite ^.*$ /seats/index.html last;
}
-----------------------------------------------------------------------------
// 正确配置,应该区分开来
location ^~/visitor/ {try_files $uri $uri/ @visitor_router;alias /nsfocus/local/nginx/html/visitor/;index index.html;
}
location @visitor_router{rewrite ^.*$ /visitor/index.html last;
}location ^~/seats/ {try_files $uri $uri/ @seats_router;alias /nsfocus/local/nginx/html/seats/;index index.html;
}
location @seats_router{rewrite ^.*$ /seats/index.html last;
}
查看全文
99%的人还看了
相似问题
- conda创建pytorch环境报错
- Python通过selenium调用IE11浏览器报错解决方法
- kafka本地安装报错
- 【BUG】第一次创建vue3+vite项目启动报错Error: Cannot find module ‘worker_threads‘
- git 构建报错
- Docker build报错总结,版本过新大避雷!
- Mongodb3.4升级高版本mongoTemplate.executeCommand报错The cursor option is required
- duplicate复制数据库单个数据文件复制失败报错rman-03009 ora-03113
- 安装第三方包报错 error: Microsoft Visual C++ 14.0 or greater is required——解决办法
- 邮件|gitpushgithub报错|Lombok注解
猜你感兴趣
版权申明
本文"浏览器控制台报错Failed to load module script:解决方法":http://eshow365.cn/6-35244-0.html 内容来自互联网,请自行判断内容的正确性。如有侵权请联系我们,立即删除!
- 上一篇: 第12章 PyTorch图像分割代码框架-2
- 下一篇: MapReduce:大数据处理的范式