Unverified Commit e15741da authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

Remove empty config warning (#49435)

## What?

Removes the empty `next.config.js` warning. Given that `create-next-app` now ships with an empty config with the type definition comment the warning is no longer needed.

## How?

Removed the warning, removed the tests.

Fixes NEXT-1107
parent 7e02f11e
......@@ -779,12 +779,6 @@ export default async function loadConfig(
}
}
if (Object.keys(userConfig).length === 0) {
curLog.warn(
`Detected ${configFileName}, no exported configuration found. https://nextjs.org/docs/messages/empty-configuration`
)
}
if (userConfig.target && userConfig.target !== 'server') {
throw new Error(
`The "target" property is no longer supported in ${configFileName}.\n` +
......
/* eslint-disable */
{
experimental: {
basePath: '/docs'
}
}
export default () => <div>Hello World</div>
/* eslint-env jest */
import { join } from 'path'
import {
nextBuild,
launchApp,
findPort,
killApp,
waitFor,
} from 'next-test-utils'
const appDir = join(__dirname, '..')
describe('Empty configuration', () => {
it('should show relevant warning and compile successfully for next build', async () => {
const { stderr, stdout } = await nextBuild(appDir, [], {
stderr: true,
stdout: true,
})
expect(stdout).toMatch(/Compiled successfully/)
expect(stderr).toMatch(
/Detected next\.config\.js, no exported configuration found\. https:\/\//
)
})
it('should show relevant warning and compile successfully for next dev', async () => {
let stderr = ''
const appPort = await findPort()
const app = await launchApp(appDir, appPort, {
onStderr(msg) {
stderr += msg || ''
},
})
await waitFor(1000)
await killApp(app)
expect(stderr).toMatch(
/Detected next\.config\.js, no exported configuration found\. https:\/\//
)
})
})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment