Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serve Dynamic Content with Express not deploys cloud function #6878

Open
georgelviv opened this issue Mar 14, 2024 · 0 comments
Open

Serve Dynamic Content with Express not deploys cloud function #6878

georgelviv opened this issue Mar 14, 2024 · 0 comments

Comments

@georgelviv
Copy link

georgelviv commented Mar 14, 2024

[REQUIRED] Environment info

firebase-tools: 13.5.0

Platform: macOS (M1)

[REQUIRED] Test case

I want to deploy react app build with vite and express.js server for SSR. I've used next code template from vite.
I've followed all mentioned steps described in Serve Dynamic Content and it's deploys static content but not cloud function (express server).

server.js

import express from 'express';

export function app() {
  // Create http server
  const app = express();
  return app;
}

firebase.json

{
  "hosting": {
    "source": ".",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ],
    "frameworksBackend": {
      "region": "europe-west1"
    }
  }
}

package.json

{
  "name": "dyvoxyz",
  "type": "module",
  "directories": {
    "serve": "dist/client"
  },
  "files": ["dist/client", "server.js"],
  "main": "server.js",

[REQUIRED] Steps to reproduce

  1. Create project with react and vite, configure SSR using next code as template
  2. $ firebase experiments:enable webframeworks
  3. $ firebase init hosting
  4. Add next attributes to package.json
 "directories": {
    "serve": "dist/client"
  },
  "files": ["dist", "server.js"],
  "main": "server.js",
  1. $ firebase deploy

[REQUIRED] Expected behavior

Should deploy server.js as cloud function

[REQUIRED] Actual behavior

Deploys only static files

image
@georgelviv georgelviv changed the title Serve Dynamic Content with Express not deploys any cloud function Serve Dynamic Content with Express not deploys cloud function Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants