Skip to content

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

@dzak83

Description

@dzak83

[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" },
  6. 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions