firebase / firebase/firebase-tools

Integrate other frameworks with Express.js - not detecting server.js

Open
#7,614 0 comments 0 reactions 0 assignees View on GitHub
integration: web frameworks type: bug
Dominant language
TypeScript
Stars
4.5k
Forks
1.3k
Avg merge
1d 12h
Merged PRs (30d)
84

Description

### [REQUIRED] Environment info

**firebase-tools:** 13.4.1

**Platform:** Windows

### [REQUIRED] Test case

I am deploying Vite React SSR solution for Firebase Express.js but it's not detecting server.js

### [REQUIRED] Steps to reproduce

1. Clone Vite React SSR example: https://github.com/bluwy/create-vite-extra/tree/master/template-ssr-react
2. Run locally and confirm it works with vite
3. Follow firebase setup as per https://firebase.google.com/docs/hosting/frameworks/express, so:
4. Make sure source is set to
`"hosting": {
"source": "."
}`
5. Add in package.json
`"directories": {
"serve": "dist"
},`
7. `firebase deploy`

### [REQUIRED] Expected behavior
server.js is running and is replacing html parts

### [REQUIRED] Actual behavior
server.js is not running

I tried many configuration options but I don't think express is running at all. If I navigate manually to https://{myapp}.web.app/client the index.html from client react will render react page but without server rendering so I know that hosting is up and fine for client.
When I navigate to https://{myapp}.web.app/server/entry-server.js I also see the file.

I also tried adding to package.json:
`"files": ["dist", "server.js"],
"main": "server.js",`
but it didn't resolve the problem.

This feature is so new that I have issues to find any other tutorial online and after trying many configurations I think it might be broken.

Let me know if I can provide better logs to debug.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.