Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'canary' into skip/docs-native-test
- Loading branch information
Showing
5 changed files
with
62 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# next.config.js Loading Error | ||
|
||
#### Why This Error Occurred | ||
|
||
When attempting to load your `next.config.js` file an error occurred. This could be due to a syntax error or attempting to `require` a module that wasn't available. | ||
|
||
#### Possible Ways to Fix It | ||
|
||
See the error message in your terminal where you started `next` to see more context. The `next.config.js` file is not transpiled by Next.js currently so ensure only features supported by your current node.js version are being used. | ||
|
||
### Useful Links | ||
|
||
- [next.config.js documentation](https://nextjs.org/docs/api-reference/next.config.js/introduction) | ||
- [node.js version feature chart](https://node.green/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function Page(props) { | ||
return <p>index page</p> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* eslint-env jest */ | ||
import fs from 'fs-extra' | ||
import { join } from 'path' | ||
import { nextBuild } from 'next-test-utils' | ||
|
||
jest.setTimeout(1000 * 60 * 1) | ||
const appDir = join(__dirname, '..') | ||
const nextConfig = join(appDir, 'next.config.js') | ||
|
||
describe('Invalid resolve alias', () => { | ||
it('should show relevant error when webpack resolve alias is wrong', async () => { | ||
await fs.writeFile( | ||
nextConfig, | ||
` | ||
module.exports = { | ||
reactStrictMode: true,, | ||
} | ||
` | ||
) | ||
const { stderr } = await nextBuild(appDir, undefined, { | ||
stderr: true, | ||
}) | ||
await fs.remove(nextConfig) | ||
|
||
expect(stderr).toContain( | ||
'Error: failed to load next.config.js, see more info here https://nextjs.org/docs/messages/next-config-error' | ||
) | ||
expect(stderr).toContain('SyntaxError') | ||
}) | ||
}) |