-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
next.config.js that doesn't export anything doesn't throw error #9919
Comments
Looking at #9921 and at https://nodejs.org/dist/latest-v6.x/docs/api/modules.html#modules_module_require_id looks like we cannot distinguish using require when there is an empty object or nothing is exported. |
@dmitrika yeah unfortunately it's tricky to detects, would improve DX quite a bit though, we got multiple users that didn't export their config. Potentially we could show a warning along the lines of "Detected next.config.js, no exported configuration found" |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Bug report
Describe the bug
When you have an empty next.config.js no error is thrown, which can cause confusion.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
yarn create next-app --example hello-world
next.config.js
with contents:yarn dev
, everything works but obviously the option isn't applied.Expected behavior
Next.js should throw an error when there is no object exported from
next.config.js
.System information
Additional context
Just a small DX improvement.
The text was updated successfully, but these errors were encountered: