'Deployed several HTML sites but unable to host React on Firebase
I have successfully deployed several HTML sites on Firebase but this time trying to publish the React one written on TypeScript when I visit it says Site Not Found
I found one should use build folder when deploying to firebase to look for source, unfortunately I can't find any build but dist available, so I tried the same
Overview of my app structure
srccontains assets, main.tsx etcpublic(empty directory)distgets generated and contains index.html, assetsrootcontains src, public, dist, index.html, package.json etc
I hope you've realized, I am new to React and just started with a simple Hello World app (works great offline) and just trying to host same on Firebase
Following NPM Commands, I've used to build and run an app offline
- npm
install - npm
run build - npm
run dev
That's what package.json looks
{
"name": "helloworld",
"version": "0.0.1",
"private": false,
"scripts": {
"build": "tsc && vite build",
"dev": "vite",
"format": "prettier --write .",
"lint": "eslint --fix . --ext .ts,.tsx",
"lint:css": "stylelint --fix '**/*.css'",
"preview": "vite preview"
},
....
}
Link to YouTube tutorial, I always follow to host a website on Firebase
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
