password
查看人数
type
status
date
slug
summary
category
icon
tags
作者
状态
😀
react npm run build 打包后访问index.html 出现You need to enable JavaScript to run this app.发布生产打开页面出现空白.

产生原因

该问题的原因在于,打包后的index.html页面无法正确加载编译后的JavaScript脚本文件,index.html没有成功引入打包后的JS资源。
 

解决办法是

在你还没打包之前找到package.json这个文件,添加一行"homepage":"./"就可以了。
notion image
在重新执行npm run build 就可以了
 

默认打包后的title展示为React App,

应该改/public/index.html中title字段,这些每一次打包都是自己想要的了
 
💡
有关使用上的问题,欢迎您在底部评论区留言,一起交流~
react 实现enter提交内容claude2 个人调试版
Loading...