kriasoft / kriasoft/react-firebase-starter
Has anyone successfully deployed yet?
- Dominant language
- JavaScript
- Stars
- 4.5k
- Forks
- 752
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I just start using the starter and it works great, awesome react starter. I've configured everything in firebase.google.com and .env files, following the readme and deployment guide here: https://github.com/kriasoft/react-firebase-starter/wiki/deployment.
But my problem is that when I want to build and deploy, no html files are produced, not even index.html. I've not modified anything except for .env file.
I've logged the details below, anonymizing them with < your site > and < your project > labels.
node: 10.16.0, npm: 6.9.0
1) react-app build
```
Creating an optimized production build...
Compiled successfully.
File sizes after gzip:
110.27 KB public/static/js/12.6d7953a1.chunk.js
9.56 KB public/static/js/13.e23a3e23.chunk.js
7.64 KB public/static/js/main.cd86c8ac.chunk.js
5.45 KB public/static/js/home.9b60061d.chunk.js
3.3 KB public/static/js/login.68f29246.chunk.js
3.13 KB public/static/js/news.6aa2d53f.chunk.js
2.04 KB public/static/js/terms.a6d1de80.chunk.js
1.29 KB public/static/js/runtime~main.1786bd33.js
1.08 KB public/static/js/privacy.4c391e9d.chunk.js
984 B public/static/js/admin.a63c9224.chunk.js
915 B public/static/js/user-profile.30e141ac.chunk.js
803 B public/static/js/account.1f7da118.chunk.js
641 B public/static/js/about.913f482e.chunk.js
626 B public/static/js/story.2a8b8363.chunk.js
The project was built assuming it is hosted at .
You can control this with the homepage field in your package.json.
The build/public folder is ready to be deployed.
You may serve it with a static server:
yarn global add serve
serve -s build/public
```
2) yarn deploy-prod
Comments: the app exists with firebase.google.com, not with cloud appengine though
```
yarn run v1.17.3
$ firebase --project= deploy && node ./scripts/post-deploy --env=prod
=== Deploying to ''...
i deploying storage, functions, hosting
There was an issue deploying your functions. Verify that your project has a Google App Engine instance setup at https://console.cloud.google.com/appengine and try again. If this issue persists, please contact support.
Error: HTTP Error: 404, Could not find Application "".
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
```
3) firebase deploy --only functions
```
=== Deploying to ''...
i deploying functions
i functions: ensuring necessary APIs are enabled...
✔ functions: all necessary APIs are enabled
i functions: preparing . directory for uploading...
Error: Error occurred while parsing your function triggers.
SyntaxError: Unexpected token c in JSON at position 0
at JSON.parse ()
at Object. (/home/webserver/app/build/server.js:764:92)
at __webpack_require__ (/home/webserver/app/build/server.js:21:30)
at /home/webserver/app/build/server.js:85:18
at Object. (/home/webserver/app/build/server.js:88:10)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
```
4) firebase deploy --only hosting
comments: works fine, it registers and loads images and favicon.ico to the remote firebase server, but no html files are produced inside ./build/public
```
=== Deploying to ''...
i deploying hosting
i hosting[]: beginning deploy...
i hosting[]: found 46 files in ./build/public
✔ hosting[]: file upload complete
i hosting[]: finalizing version...
✔ hosting[]: version finalized
i hosting[]: releasing new version...
✔ hosting[]: release complete
✔ Deploy complete!
```
5) firebase serve --only hosting
This produces the same result as deploying to firebase servers,
```
i hosting: Serving hosting files from: public
✔ hosting: Local server: http://localhost:5000
```
6) firebase serve
```
=== Serving from '/home/webserver/your_project'...
✔ functions: Using node@10 from host.
i hosting: Serving hosting files from: public
✔ hosting: Local server: http://localhost:5000
✔ functions: Emulator started at http://localhost:5001
i functions: Watching "/home/webserver/your_project" for Cloud Functions...
⚠ TypeError: Cannot convert undefined or null to object
at Function.keys ()
at Object. (/home/webserver/your_project/build/server.js:762:89)
at __webpack_require__ (/home/webserver/your_project/build/server.js:21:30)
at /home/webserver/your_project/build/server.js:85:18
at Object. (/home/webserver/your_project/build/server.js:88:10)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
⚠ We were unable to load your functions code. (see above)
- You may be able to run "npm run build" in your functions directory to resolve this.
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the reported `react-app build`, `yarn deploy-prod`, and Firebase deployment commands with the documented `.env` setup. Inspect the stack traces in `build/server.js` and the `scripts/post-deploy` entry point, then compare the deployment guide with the observed Firebase Hosting and Functions behavior. Done means the build produces the expected HTML and the documented deployment path completes successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- firebase, javascript, node.js, react
- Domain
- build-system, cloud, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100