繁体   English   中英

Firebase 托管网站显示欢迎页面而不是实际网站

[英]Firebase hosted website shows welcome page not the actual website

我正在尝试使用 firebase 托管 React 网站。 我使用 firebase 作为后端。 我已经使用 firebase 部署了一个网站,它之前运行良好。 只有这次部署的 url 继续显示欢迎页面。 我曾尝试删除 firebase 文件并多次尝试firebase init仍然面临同样的问题。 我尝试以隐身模式打开文件,但它显示相同的内容。

托管 url: https://recipe-661e9.web.app/

我从npm install -g firebase-tools开始,效果很好

然后我做了firebase login ,它显示我已经登录。

然后firebase init

firebase init之后,这些是我做出的选择

Which Firebase features do you want to set up for this director
y? Press Space to select features, then Enter to confirm your cho
ices. Hosting: Configure files for Firebase Hosting and (optional
ly) set up GitHub Action deploys

Please select an option: Use an existing project
? Select a default Firebase project for this directory: recipe-661e9 (Recipe)

 What do you want to use as your public directory? build
? Configure as a single-page app (rewrite all urls to /index.html)? Yes
? Set up automatic builds and deploys with GitHub? No
✔  Wrote build/index.html

i  Writing configuration info to firebase.json...
i  Writing project information to .firebaserc...

✔  Firebase initialization complete!

在此之后,我运行npm run build ,然后运行firebase deploy --only hosting

我用谷歌搜索了多次,但没有找到解决方案。 我尝试删除 firebase.json、.firebaserc 文件及其文件夹并再次运行这些命令但同样的事情。 我试过删除构建文件夹仍然没有改善

部署公共目录而不是构建

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM