Skip to content

Running firebase deploy for Next Js  #5661

@friday-sds

Description

@friday-sds

[REQUIRED] Environment info

firebase-tools: 11.25.2
Node Js: 16.14.2

Platform: macOS (m1 / arm64)

[REQUIRED] Steps to reproduce

Try following this doc for a basic next js 13 (appDir) project

[REQUIRED] Expected behavior

Your app should deploy in firebase hosting and you will have an url

[REQUIRED] Actual behavior

Getting this error
`Building a Cloud Function to run this application. This is needed due to:
• app directory (unstable)

info - Creating an optimized production build ...[2023-04-05T12:05:37.437Z] TypeError: Cannot read properties of null (reading 'endsWith')
at ɵcodegenPublicDirectory (/Users/xyz/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/frameworks/next/index.js:206:56)
at async prepareFrameworks (/Users/xyz/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/frameworks/index.js:269:13)
at async deploy (/Users/xyz/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/deploy/index.js:53:13)

Error: An unexpected error has occurred.
info - Creating an optimized production build ..%`

Next Js Config
`/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
appDir: true,
},
}

module.exports = nextConfig`

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