Skip to content

"firebase deploy --only hosting" doesnt pick up next.config.ts anymore #9854

@TrySpace

Description

@TrySpace

[REQUIRED] Environment info

"firebase-tools": "^15.5.1",

Windows 10

[REQUIRED] Test case

This worked before, but stopped working today (possibly after reinstalling packages)

firebase deploy --only hosting:dev-ssr -P dev-project

[REQUIRED] Steps to reproduce

have package.json:

  "scripts": {
    "dev": "env-cmd -f ../../.env.development next dev",
    "build": "yarn prenext && env-cmd -f ../../.env.development next build",
    "deploy:next:dev": "env-cmd -f ../../.env.development firebase deploy --only hosting:dev-ssr -P dev-project",
...

have .firebaserc:

 "projects": {
    "dev-project": "xxxx-xxxx"
  },
 "targets": {
    "xxxx-xxxx": {
      "hosting": {
        "dev-ssr": [
          "hosting-name-xxx"
        ]
      }
    },
}

have firebase.json:

{
  "hosting": [
    {
      "target": "dev-ssr",
      "source": ".",
      "ignore": [
        "firebase.json",
        "**/.*",
        "**/node_modules/**"
      ]
    }   
  ],
"frameworksBackend": {
    "region": "europe-west1",
    "memory": "512MiB",
    "cpu": "1",
    "minInstances": 0,
    "maxInstances": 3
  },
  "functions": [
    {
      "source": "functions",
      "runtime": "nodejs20",
      "codebase": "default",
      "ignore": [
        "node_modules",
        ".git",
        "firebase-debug.log",
        "firebase-debug.*.log"
      ]
    }
  ],
...
}

and a nextjs project

[REQUIRED] Expected behavior

I believe it previously detected if it was run in a nextjs project, and would then run the next build command automagically, then deploy to firebase hosting

[REQUIRED] Actual behavior

WARNING: Your package.json contains a custom build that is being ignored. Only the Vite default build script (e.g, "vite build") is respected. If you have a more advanced build process you should build a custom integration https://firebase.google.com/docs/hosting/express       

vite v6.4.1 building for production...
✓ 0 modules transformed.
✗ Build failed in 19ms

Error: An unexpected error has occurred.

I'm not getting an error log file...

Update

Renaming next.config.ts to next.config.js actually detects and now builds nextjs

Previously this was working with the ts file... Not sure what changed, afaik I am using the same versions as before (only difference I know is that I had a reinstall of packages)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions