Skip to content

Commit

Permalink
fix: 9919 add error page and link to it in warning
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrika committed Jan 28, 2020
1 parent 8327723 commit 568286d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
19 changes: 19 additions & 0 deletions errors/empty-configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Detected next.config.js, no exported configuration found

#### Why This Warning Occurred

There is no object exported from next.config.js or the object is empty.

#### Possible Ways to Fix It

Check if you export correctly configuration in next.config.js file:

```
module.exports = {
/* config options here */
}
```

### Useful Links

- [Introduction to next.config.js](https://nextjs.org/docs/api-reference/next.config.js/introduction)
2 changes: 1 addition & 1 deletion packages/next/next-server/server/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ export default function loadConfig(
if (Object.keys(userConfig).length === 0) {
console.warn(
chalk.yellow.bold('Warning: ') +
'Detected next.config.js, no exported configuration found.'
'Detected next.config.js, no exported configuration found. https://err.sh/zeit/next.js/empty-configuration'
)
}

Expand Down
4 changes: 2 additions & 2 deletions test/integration/config-empty/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('Empty configuration', () => {
})
expect(stdout).toMatch(/Compiled successfully./)
expect(stderr).toMatch(
/Warning: Detected next.config.js, no exported configuration found./
/Warning: Detected next.config.js, no exported configuration found. https:\/\/err.sh\/zeit\/next.js\/empty-configuration/
)
})

Expand All @@ -38,7 +38,7 @@ describe('Empty configuration', () => {
await killApp(app)

expect(stderr).toMatch(
/Warning: Detected next.config.js, no exported configuration found./
/Warning: Detected next.config.js, no exported configuration found. https:\/\/err.sh\/zeit\/next.js\/empty-configuration/
)
})
})

0 comments on commit 568286d

Please sign in to comment.