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

The command line is too long. #7250

Closed
jong-circuit opened this issue Jun 3, 2024 · 4 comments
Closed

The command line is too long. #7250

jong-circuit opened this issue Jun 3, 2024 · 4 comments

Comments

@jong-circuit
Copy link

jong-circuit commented Jun 3, 2024

[REQUIRED] Environment info

firebase-tools : 13.11.2

Platform : Windows

Next.js : 14.2.4

[REQUIRED] Test case

N/A

[REQUIRED] Steps to reproduce

  1. Run firebase deploy command

[REQUIRED] Expected behavior

N/A

[REQUIRED] Actual behavior

I'm using Next.js with hosting integration.
I'm getting the following error when deploying:

...

Building a Cloud Function to run this application. This is needed due to:
 • middleware
 • non-static component /[locale]/[...rest]/page
 • non-static component /[locale]/page

Unable to bundle next.config.mjs for use in Cloud Functions, proceeding with deploy but problems may be encountered.
The command line is too long.

...

However, a final message indicating that deployment has been completed successfully is displayed.

@jong-circuit
Copy link
Author

jong-circuit commented Jun 3, 2024

My next.config.mjs file code is:

import createNextIntlPlugin from "next-intl/plugin";

const withNextIntl = createNextIntlPlugin();

/** @type {import("next").NextConfig} */
const nextConfig = {};

export default withNextIntl(nextConfig);

Related issues

  1. https://stackoverflow.com/questions/77783368/unable-to-bundle-next-config-js-for-use-in-cloud-functions-firebase-next-js

@leoortizz
Copy link
Member

Hey @busanTeddyBear, can you please share your package.json?

@leoortizz leoortizz added the Needs: Author Feedback Issues awaiting author feedback label Jun 11, 2024
@jong-circuit
Copy link
Author

@leoortizz

Yes, of course.

This is the /hosting/package.json file content:

{
    "name": "hosting",
    "version": "0.1.0",
    "private": true,
    "scripts": {
        "dev": "next dev",
        "build": "next build",
        "start": "next start",
        "lint": "next lint"
    },
    "dependencies": {
        "@heroicons/react": "^2.1.3",
        "@nextui-org/react": "^2.4.1",
        "framer-motion": "^11.2.10",
        "next": "^14.2.3",
        "next-intl": "^3.15.0",
        "next-themes": "^0.3.0",
        "react": "^18.3.1",
        "react-device-detect": "^2.2.3",
        "react-dom": "^18.3.1",
        "zustand": "^4.5.2"
    },
    "devDependencies": {
        "@types/node": "^20.14.2",
        "@types/react": "^18.3.3",
        "@types/react-dom": "^18.3.0",
        "autoprefixer": "^10.4.19",
        "eslint": "^8.57.0",
        "eslint-config-next": "^14.2.3",
        "eslint-plugin-perfectionist": "^2.10.0",
        "postcss": "^8.4.38",
        "prettier": "^3.3.2",
        "prettier-plugin-tailwindcss": "^0.6.2",
        "tailwindcss": "^3.4.4",
        "typescript": "^5.4.5"
    }
}

This is the /functions/package.json file content:

{
    "name": "functions",
    "description": "Cloud Functions for Firebase",
    "scripts": {
        "serve": "firebase emulators:start --only functions",
        "shell": "firebase functions:shell",
        "start": "npm run shell",
        "deploy": "firebase deploy --only functions",
        "logs": "firebase functions:log"
    },
    "engines": {
        "node": "20"
    },
    "main": "index.js",
    "dependencies": {
        "firebase-admin": "^12.1.1",
        "firebase-functions": "^5.0.1"
    },
    "devDependencies": {
        "firebase-functions-test": "^3.3.0"
    },
    "private": true
}

This is the /firebase.json file content:

{
    "firestore": {
        "rules": "firestore.rules",
        "indexes": "firestore.indexes.json"
    },

    "functions": [
        {
            "source": "functions",
            "codebase": "default",

            "ignore": [
                "node_modules",
                ".git",
                "firebase-debug.log",
                "firebase-debug.*.log"
            ]
        }
    ],

    "hosting": {
        "source": "hosting",
        "ignore": ["firebase.json", "**/.*", "**/node_modules/**"],

        "rewrites": [
            {
                "source": "/apis/getChatCompletions",

                "function": {
                    "functionId": "getChatCompletions"
                }
            }
        ],

        "frameworksBackend": {
            "region": "asia-northeast3"
        }
    },

    "storage": {
        "rules": "storage.rules"
    },

    "emulators": {
        "functions": {
            "port": 5001
        },

        "firestore": {
            "port": 8080
        },

        "hosting": {
            "port": 5000
        },

        "storage": {
            "port": 9199
        },

        "ui": {
            "enabled": true
        },

        "singleProjectMode": true
    }
}

@jong-circuit
Copy link
Author

I will close this issue since the error mentioned here no longer occurs starting from firebase-tools: 13.15.1.

However, another problem has arisen from this, so I have created a new issue.

#7549

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

4 participants