【发布时间】:2022-07-22 23:39:45
【问题描述】:
我有一个 React 网站,我正在尝试使用 GIthub 页面进行部署。 在按照步骤部署我的应用程序时,我收到以下错误:
Failed to compile.
static/css/main.9a1ecd2c.css from Css Minimizer plugin
Error: Unexpected '/'. Escaping special characters with \ may help.
我遵循的步骤:
1) 创建一个 repo。
2)链接本地和远程仓库
3) 将 URL 添加到我的 package.json 文件中。
4) 安装 gh-pages
5)添加重新部署和部署脚本为:
"predeploy":"npm run build",
"deploy":"gh-pages -d build",
6) 运行 npm run deploy
【问题讨论】:
-
你有一个 / 不应该有一个,它与 repo 无关,错误消息说“错误:意外'/'。”找到那个 / 并删除它跨度>
-
@WillBrobin 我在哪里可以找到它?它应该在我的代码文件中吗?
-
它将在代码中,很可能是一个特殊字符,看起来不像
-
@WillBrobin 我检查了所有地方,我的代码没有损坏,也没有找到符号
标签: reactjs github deployment github-pages