Skip to content

Should the Next config file be mandatory? #1111

@dario-piotrowicz

Description

@dario-piotrowicz

checkRunningInsideNextjsApp works based on the assumption that there must be a Next config file for the application:

logger.error(
"Error: next.config.js not found. Please make sure you are running this command inside a Next.js app.",
);
process.exit(1);

If such a file does not exist this function forcefully terminates the process.

The issue is that I think that the Next config file is actually not mandatory, for example take the following starter from Vercel: https://vercel.com/templates/portfolio/portfolio-starter-kit (https://github.com/vercel/examples/tree/main/solutions/blog), there is no Next config file, but Next.js doesn't seem to be a problem.

Additionally in the Next.js docs there isn't a mention that the Next config file is mandatory, they say that "Next.js can be configured through a next.config.js file" (not that it needs to be).

So ideally OpenNext should also support applications without the Next config file?

Note: I suspect that the vast majority of Next.js applications do include a next config file (create-next-app does create one for you) so maybe this is not a huge concern, I figured I'd raise the question anyways

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions