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

Update err.sh links to use nextjs.org/docs/messages instead (#23353)

parent d49f978a
...@@ -132,7 +132,7 @@ npx @next/codemod withamp-to-config ...@@ -132,7 +132,7 @@ npx @next/codemod withamp-to-config
### `url-to-withrouter` ### `url-to-withrouter`
Transforms the deprecated automatically injected `url` property on top level pages to using `withRouter` and the `router` property it injects. Read more here: [err.sh/next.js/url-deprecated](https://err.sh/next.js/url-deprecated) Transforms the deprecated automatically injected `url` property on top level pages to using `withRouter` and the `router` property it injects. Read more here: [https://nextjs.org/docs/messages/url-deprecated](https://nextjs.org/docs/messages/url-deprecated)
For example: For example:
......
...@@ -26,6 +26,6 @@ This folder is also useful for `robots.txt`, `favicon.ico`, Google Site Verifica ...@@ -26,6 +26,6 @@ This folder is also useful for `robots.txt`, `favicon.ico`, Google Site Verifica
> **Note**: Be sure to not have a static file with the same name as a file in the `pages/` directory, as this will result in an error. > **Note**: Be sure to not have a static file with the same name as a file in the `pages/` directory, as this will result in an error.
> >
> Read more: <http://err.sh/next.js/conflicting-public-file-page> > Read more: <https://nextjs.org/docs/messages/conflicting-public-file-page>
> **Note**: Only assets that are in the `public` directory at [build time](/docs/api-reference/cli.md#build) will be served by Next.js. Files added at runtime won't be available. We recommend using a third party service like [AWS S3](https://aws.amazon.com/s3/) for persistent file storage. > **Note**: Only assets that are in the `public` directory at [build time](/docs/api-reference/cli.md#build) will be served by Next.js. Files added at runtime won't be available. We recommend using a third party service like [AWS S3](https://aws.amazon.com/s3/) for persistent file storage.
...@@ -98,7 +98,7 @@ const React = require('react') ...@@ -98,7 +98,7 @@ const React = require('react')
if (typeof React.Suspense === 'undefined') { if (typeof React.Suspense === 'undefined') {
throw new Error( throw new Error(
`The version of React you are using is lower than the minimum required version needed for Next.js. Please upgrade "react" and "react-dom": "npm install react react-dom" https://err.sh/vercel/next.js/invalid-react-version` `The version of React you are using is lower than the minimum required version needed for Next.js. Please upgrade "react" and "react-dom": "npm install react react-dom" https://nextjs.org/docs/messages/invalid-react-version`
) )
} }
......
...@@ -30,7 +30,7 @@ function replaceBundle(path: any, t: typeof BabelTypes): void { ...@@ -30,7 +30,7 @@ function replaceBundle(path: any, t: typeof BabelTypes): void {
function errorMessage(state: any, details: string): string { function errorMessage(state: any, details: string): string {
const pageName = const pageName =
(state.filename || '').split(state.cwd || '').pop() || 'unknown' (state.filename || '').split(state.cwd || '').pop() || 'unknown'
return `Invalid page config export found. ${details} in file ${pageName}. See: https://err.sh/vercel/next.js/invalid-page-config` return `Invalid page config export found. ${details} in file ${pageName}. See: https://nextjs.org/docs/messages/invalid-page-config`
} }
interface ConfigState extends PluginPass { interface ConfigState extends PluginPass {
......
...@@ -6,7 +6,7 @@ export default function NextPageDisallowReExportAllExports(): PluginObj<any> { ...@@ -6,7 +6,7 @@ export default function NextPageDisallowReExportAllExports(): PluginObj<any> {
ExportAllDeclaration(path: NodePath<types.ExportAllDeclaration>) { ExportAllDeclaration(path: NodePath<types.ExportAllDeclaration>) {
const err = new SyntaxError( const err = new SyntaxError(
`Using \`export * from '...'\` in a page is disallowed. Please use \`export { default } from '...'\` instead.\n` + `Using \`export * from '...'\` in a page is disallowed. Please use \`export { default } from '...'\` instead.\n` +
`Read more: https://err.sh/next.js/export-all-in-page` `Read more: https://nextjs.org/docs/messages/export-all-in-page`
) )
;(err as any).code = 'BABEL_PARSE_ERROR' ;(err as any).code = 'BABEL_PARSE_ERROR'
;(err as any).loc = ;(err as any).loc =
......
...@@ -14,7 +14,7 @@ export async function generateBuildId( ...@@ -14,7 +14,7 @@ export async function generateBuildId(
if (typeof buildId !== 'string') { if (typeof buildId !== 'string') {
throw new Error( throw new Error(
'generateBuildId did not return a string. https://err.sh/vercel/next.js/generatebuildid-not-a-string' 'generateBuildId did not return a string. https://nextjs.org/docs/messages/generatebuildid-not-a-string'
) )
} }
......
...@@ -151,7 +151,7 @@ export default async function build( ...@@ -151,7 +151,7 @@ export default async function build(
// Intentionally not piping to stderr in case people fail in CI when // Intentionally not piping to stderr in case people fail in CI when
// stderr is detected. // stderr is detected.
console.log( console.log(
`${Log.prefixes.warn} No build cache found. Please configure build caching for faster rebuilds. Read more: https://err.sh/next.js/no-cache` `${Log.prefixes.warn} No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache`
) )
} }
} }
...@@ -302,7 +302,7 @@ export default async function build( ...@@ -302,7 +302,7 @@ export default async function build(
throw new Error( throw new Error(
`Conflicting public and page file${ `Conflicting public and page file${
numConflicting === 1 ? ' was' : 's were' numConflicting === 1 ? ' was' : 's were'
} found. https://err.sh/vercel/next.js/conflicting-public-file-page\n${conflictingPublicFiles.join( } found. https://nextjs.org/docs/messages/conflicting-public-file-page\n${conflictingPublicFiles.join(
'\n' '\n'
)}` )}`
) )
...@@ -319,7 +319,7 @@ export default async function build( ...@@ -319,7 +319,7 @@ export default async function build(
Log.warn( Log.warn(
`The following reserved Next.js pages were detected not directly under the pages directory:\n` + `The following reserved Next.js pages were detected not directly under the pages directory:\n` +
nestedReservedPages.join('\n') + nestedReservedPages.join('\n') +
`\nSee more info here: https://err.sh/next.js/nested-reserved-page\n` `\nSee more info here: https://nextjs.org/docs/messages/nested-reserved-page\n`
) )
} }
...@@ -450,7 +450,7 @@ export default async function build( ...@@ -450,7 +450,7 @@ export default async function build(
if (!distDirCreated || !(await isWriteable(distDir))) { if (!distDirCreated || !(await isWriteable(distDir))) {
throw new Error( throw new Error(
'> Build directory is not writeable. https://err.sh/vercel/next.js/build-dir-not-writeable' '> Build directory is not writeable. https://nextjs.org/docs/messages/build-dir-not-writeable'
) )
} }
...@@ -537,7 +537,7 @@ export default async function build( ...@@ -537,7 +537,7 @@ export default async function build(
clientConfig.optimization.minimizer.length === 0)) clientConfig.optimization.minimizer.length === 0))
) { ) {
Log.warn( Log.warn(
`Production code optimization has been disabled in your project. Read more: https://err.sh/vercel/next.js/minification-disabled` `Production code optimization has been disabled in your project. Read more: https://nextjs.org/docs/messages/minification-disabled`
) )
} }
...@@ -599,7 +599,7 @@ export default async function build( ...@@ -599,7 +599,7 @@ export default async function build(
const parsed = page_name_regex.exec(error) const parsed = page_name_regex.exec(error)
const page_name = parsed && parsed.groups && parsed.groups.page_name const page_name = parsed && parsed.groups && parsed.groups.page_name
throw new Error( throw new Error(
`webpack build failed: found page without a React Component as default export in pages/${page_name}\n\nSee https://err.sh/vercel/next.js/page-without-valid-component for more info.` `webpack build failed: found page without a React Component as default export in pages/${page_name}\n\nSee https://nextjs.org/docs/messages/page-without-valid-component for more info.`
) )
} }
...@@ -611,7 +611,7 @@ export default async function build( ...@@ -611,7 +611,7 @@ export default async function build(
error.indexOf('__next_polyfill__') > -1 error.indexOf('__next_polyfill__') > -1
) { ) {
throw new Error( throw new Error(
'> webpack config.resolve.alias was incorrectly overridden. https://err.sh/vercel/next.js/invalid-resolve-alias' '> webpack config.resolve.alias was incorrectly overridden. https://nextjs.org/docs/messages/invalid-resolve-alias'
) )
} }
throw new Error('> Build failed because of webpack errors') throw new Error('> Build failed because of webpack errors')
...@@ -719,7 +719,7 @@ export default async function build( ...@@ -719,7 +719,7 @@ export default async function build(
) )
) )
console.warn( console.warn(
'Read more: https://err.sh/next.js/opt-out-auto-static-optimization\n' 'Read more: https://nextjs.org/docs/messages/opt-out-auto-static-optimization\n'
) )
} }
...@@ -946,7 +946,7 @@ export default async function build( ...@@ -946,7 +946,7 @@ export default async function build(
.map((pg) => `pages${pg}`) .map((pg) => `pages${pg}`)
.join( .join(
'\n' '\n'
)}\n\nSee https://err.sh/vercel/next.js/page-without-valid-component for more info.\n` )}\n\nSee https://nextjs.org/docs/messages/page-without-valid-component for more info.\n`
) )
} }
......
...@@ -64,7 +64,7 @@ store.subscribe((state) => { ...@@ -64,7 +64,7 @@ store.subscribe((state) => {
for (const match of matches) { for (const match of matches) {
const prop = (match.split(']').shift() || '').substr(1) const prop = (match.split(']').shift() || '').substr(1)
console.log( console.log(
`AMP bind syntax [${prop}]='' is not supported in JSX, use 'data-amp-bind-${prop}' instead. https://err.sh/vercel/next.js/amp-bind-jsx-alt` `AMP bind syntax [${prop}]='' is not supported in JSX, use 'data-amp-bind-${prop}' instead. https://nextjs.org/docs/messages/amp-bind-jsx-alt`
) )
} }
return return
......
...@@ -63,7 +63,7 @@ async function collectPluginMeta( ...@@ -63,7 +63,7 @@ async function collectPluginMeta(
) )
} }
// TODO: add err.sh explaining requirements // TODO: add error link explaining requirements
let middleware: string[] = [] let middleware: string[] = []
try { try {
middleware = ( middleware = (
......
...@@ -541,7 +541,7 @@ export async function buildStaticPaths( ...@@ -541,7 +541,7 @@ export async function buildStaticPaths(
const expectedReturnVal = const expectedReturnVal =
`Expected: { paths: [], fallback: boolean }\n` + `Expected: { paths: [], fallback: boolean }\n` +
`See here for more info: https://err.sh/vercel/next.js/invalid-getstaticpaths-value` `See here for more info: https://nextjs.org/docs/messages/invalid-getstaticpaths-value`
if ( if (
!staticPathsResult || !staticPathsResult ||
...@@ -807,7 +807,7 @@ export async function isPageStatic( ...@@ -807,7 +807,7 @@ export async function isPageStatic(
if (hasStaticProps && pageIsDynamic && !hasStaticPaths) { if (hasStaticProps && pageIsDynamic && !hasStaticPaths) {
throw new Error( throw new Error(
`getStaticPaths is required for dynamic SSG pages and is missing for '${page}'.` + `getStaticPaths is required for dynamic SSG pages and is missing for '${page}'.` +
`\nRead more: https://err.sh/next.js/invalid-getstaticpaths-value` `\nRead more: https://nextjs.org/docs/messages/invalid-getstaticpaths-value`
) )
} }
...@@ -950,7 +950,7 @@ export function detectConflictingPaths( ...@@ -950,7 +950,7 @@ export function detectConflictingPaths(
Log.error( Log.error(
'Conflicting paths returned from getStaticPaths, paths must unique per page.\n' + 'Conflicting paths returned from getStaticPaths, paths must unique per page.\n' +
'See more info here: https://err.sh/next.js/conflicting-ssg-paths\n\n' + 'See more info here: https://nextjs.org/docs/messages/conflicting-ssg-paths\n\n' +
conflictingPathsOutput conflictingPathsOutput
) )
process.exit(1) process.exit(1)
......
...@@ -70,7 +70,7 @@ const devtoolRevertWarning = execOnce( ...@@ -70,7 +70,7 @@ const devtoolRevertWarning = execOnce(
chalk.yellow.bold('Warning: ') + chalk.yellow.bold('Warning: ') +
chalk.bold(`Reverting webpack devtool to '${devtool}'.\n`) + chalk.bold(`Reverting webpack devtool to '${devtool}'.\n`) +
'Changing the webpack devtool in development mode will cause severe performance regressions.\n' + 'Changing the webpack devtool in development mode will cause severe performance regressions.\n' +
'Read more: https://err.sh/next.js/improper-devtool' 'Read more: https://nextjs.org/docs/messages/improper-devtool'
) )
} }
) )
...@@ -1015,7 +1015,7 @@ export default async function getBaseWebpackConfig( ...@@ -1015,7 +1015,7 @@ export default async function getBaseWebpackConfig(
...Object.keys(config.env).reduce((acc, key) => { ...Object.keys(config.env).reduce((acc, key) => {
if (/^(?:NODE_.+)|^(?:__.+)$/i.test(key)) { if (/^(?:NODE_.+)|^(?:__.+)$/i.test(key)) {
throw new Error( throw new Error(
`The key "${key}" under "env" in next.config.js is not allowed. https://err.sh/vercel/next.js/env-key-not-allowed` `The key "${key}" under "env" in next.config.js is not allowed. https://nextjs.org/docs/messages/env-key-not-allowed`
) )
} }
...@@ -1102,7 +1102,7 @@ export default async function getBaseWebpackConfig( ...@@ -1102,7 +1102,7 @@ export default async function getBaseWebpackConfig(
new Proxy(${isServer ? 'process.env' : '{}'}, { new Proxy(${isServer ? 'process.env' : '{}'}, {
get(target, prop) { get(target, prop) {
if (typeof target[prop] === 'undefined') { if (typeof target[prop] === 'undefined') {
console.warn(\`An environment variable (\${prop}) that was not provided in the environment was accessed.\nSee more info here: https://err.sh/next.js/missing-env-value\`) console.warn(\`An environment variable (\${prop}) that was not provided in the environment was accessed.\nSee more info here: https://nextjs.org/docs/messages/missing-env-value\`)
} }
return target[prop] return target[prop]
} }
...@@ -1363,7 +1363,7 @@ export default async function getBaseWebpackConfig( ...@@ -1363,7 +1363,7 @@ export default async function getBaseWebpackConfig(
if (!webpackConfig) { if (!webpackConfig) {
throw new Error( throw new Error(
'Webpack config is undefined. You may have forgot to return properly from within the "webpack" method of your next.config.js.\n' + 'Webpack config is undefined. You may have forgot to return properly from within the "webpack" method of your next.config.js.\n' +
'See more info here https://err.sh/next.js/undefined-webpack-config' 'See more info here https://nextjs.org/docs/messages/undefined-webpack-config'
) )
} }
...@@ -1374,7 +1374,7 @@ export default async function getBaseWebpackConfig( ...@@ -1374,7 +1374,7 @@ export default async function getBaseWebpackConfig(
if (typeof (webpackConfig as any).then === 'function') { if (typeof (webpackConfig as any).then === 'function') {
console.warn( console.warn(
'> Promise returned in next config. https://err.sh/vercel/next.js/promise-in-next-config' '> Promise returned in next config. https://nextjs.org/docs/messages/promise-in-next-config'
) )
} }
} }
...@@ -1441,7 +1441,7 @@ export default async function getBaseWebpackConfig( ...@@ -1441,7 +1441,7 @@ export default async function getBaseWebpackConfig(
chalk.bold( chalk.bold(
'Built-in CSS support is being disabled due to custom CSS configuration being detected.\n' 'Built-in CSS support is being disabled due to custom CSS configuration being detected.\n'
) + ) +
'See here for more info: https://err.sh/next.js/built-in-css-disabled\n' 'See here for more info: https://nextjs.org/docs/messages/built-in-css-disabled\n'
) )
} }
......
...@@ -7,7 +7,7 @@ export function getGlobalImportError(file: string | null) { ...@@ -7,7 +7,7 @@ export function getGlobalImportError(file: string | null) {
'Custom <App>' 'Custom <App>'
)}. Please move all global CSS imports to ${chalk.cyan( )}. Please move all global CSS imports to ${chalk.cyan(
file ? file : 'pages/_app.js' file ? file : 'pages/_app.js'
)}. Or convert the import to Component-Level CSS (CSS Modules).\nRead more: https://err.sh/next.js/css-global` )}. Or convert the import to Component-Level CSS (CSS Modules).\nRead more: https://nextjs.org/docs/messages/css-global`
} }
export function getGlobalModuleImportError() { export function getGlobalModuleImportError() {
...@@ -15,7 +15,7 @@ export function getGlobalModuleImportError() { ...@@ -15,7 +15,7 @@ export function getGlobalModuleImportError() {
'cannot' 'cannot'
)} be imported from within ${chalk.bold( )} be imported from within ${chalk.bold(
'node_modules' 'node_modules'
)}.\nRead more: https://err.sh/next.js/css-npm` )}.\nRead more: https://nextjs.org/docs/messages/css-npm`
} }
export function getLocalModuleImportError() { export function getLocalModuleImportError() {
...@@ -23,7 +23,7 @@ export function getLocalModuleImportError() { ...@@ -23,7 +23,7 @@ export function getLocalModuleImportError() {
'cannot' 'cannot'
)} be imported from within ${chalk.bold( )} be imported from within ${chalk.bold(
'node_modules' 'node_modules'
)}.\nRead more: https://err.sh/next.js/css-modules-npm` )}.\nRead more: https://nextjs.org/docs/messages/css-modules-npm`
} }
export function getCustomDocumentError() { export function getCustomDocumentError() {
......
...@@ -37,7 +37,7 @@ function isIgnoredPlugin(pluginPath: string): boolean { ...@@ -37,7 +37,7 @@ function isIgnoredPlugin(pluginPath: string): boolean {
plugin plugin
)} plugin from your PostCSS configuration. ` + )} plugin from your PostCSS configuration. ` +
`This plugin is automatically configured by Next.js.\n` + `This plugin is automatically configured by Next.js.\n` +
'Read more: https://err.sh/next.js/postcss-ignored-plugin' 'Read more: https://nextjs.org/docs/messages/postcss-ignored-plugin'
) )
return true return true
} }
...@@ -119,7 +119,7 @@ export async function getPostCssPlugins( ...@@ -119,7 +119,7 @@ export async function getPostCssPlugins(
if (typeof config === 'function') { if (typeof config === 'function') {
throw new Error( throw new Error(
`Your custom PostCSS configuration may not export a function. Please export a plain object instead.\n` + `Your custom PostCSS configuration may not export a function. Please export a plain object instead.\n` +
'Read more: https://err.sh/next.js/postcss-function' 'Read more: https://nextjs.org/docs/messages/postcss-function'
) )
} }
...@@ -184,14 +184,14 @@ export async function getPostCssPlugins( ...@@ -184,14 +184,14 @@ export async function getPostCssPlugins(
)}: A PostCSS Plugin must be provided as a ${chalk.bold( )}: A PostCSS Plugin must be provided as a ${chalk.bold(
'string' 'string'
)}. Instead, we got: '${pluginName}'.\n` + )}. Instead, we got: '${pluginName}'.\n` +
'Read more: https://err.sh/next.js/postcss-shape' 'Read more: https://nextjs.org/docs/messages/postcss-shape'
) )
} else { } else {
console.error( console.error(
`${chalk.red.bold( `${chalk.red.bold(
'Error' 'Error'
)}: A PostCSS Plugin was passed as an array but did not provide its configuration ('${pluginName}').\n` + )}: A PostCSS Plugin was passed as an array but did not provide its configuration ('${pluginName}').\n` +
'Read more: https://err.sh/next.js/postcss-shape' 'Read more: https://nextjs.org/docs/messages/postcss-shape'
) )
} }
throw new Error(genericErrorText) throw new Error(genericErrorText)
...@@ -202,7 +202,7 @@ export async function getPostCssPlugins( ...@@ -202,7 +202,7 @@ export async function getPostCssPlugins(
'Error' 'Error'
)}: A PostCSS Plugin was passed as a function using require(), but it must be provided as a ${chalk.bold( )}: A PostCSS Plugin was passed as a function using require(), but it must be provided as a ${chalk.bold(
'string' 'string'
)}.\nRead more: https://err.sh/next.js/postcss-shape` )}.\nRead more: https://nextjs.org/docs/messages/postcss-shape`
) )
throw new Error(genericErrorText) throw new Error(genericErrorText)
} else { } else {
...@@ -210,7 +210,7 @@ export async function getPostCssPlugins( ...@@ -210,7 +210,7 @@ export async function getPostCssPlugins(
`${chalk.red.bold( `${chalk.red.bold(
'Error' 'Error'
)}: An unknown PostCSS plugin was provided (${plugin}).\n` + )}: An unknown PostCSS plugin was provided (${plugin}).\n` +
'Read more: https://err.sh/next.js/postcss-shape' 'Read more: https://nextjs.org/docs/messages/postcss-shape'
) )
throw new Error(genericErrorText) throw new Error(genericErrorText)
} }
......
...@@ -72,7 +72,7 @@ const nextBuild: cliCommand = (argv) => { ...@@ -72,7 +72,7 @@ const nextBuild: cliCommand = (argv) => {
) { ) {
Log.warn( Log.warn(
'React 17.0.1 or newer will be required to leverage all of the upcoming features in Next.js 11.' + 'React 17.0.1 or newer will be required to leverage all of the upcoming features in Next.js 11.' +
' Read more: https://err.sh/next.js/react-version' ' Read more: https://nextjs.org/docs/messages/react-version'
) )
} else { } else {
const reactDomVersion: string | null = await getPackageVersion({ const reactDomVersion: string | null = await getPackageVersion({
...@@ -86,7 +86,7 @@ const nextBuild: cliCommand = (argv) => { ...@@ -86,7 +86,7 @@ const nextBuild: cliCommand = (argv) => {
) { ) {
Log.warn( Log.warn(
'React 17.0.1 or newer will be required to leverage all of the upcoming features in Next.js 11.' + 'React 17.0.1 or newer will be required to leverage all of the upcoming features in Next.js 11.' +
' Read more: https://err.sh/next.js/react-version' ' Read more: https://nextjs.org/docs/messages/react-version'
) )
} }
} }
......
...@@ -73,7 +73,7 @@ const nextDev: cliCommand = (argv) => { ...@@ -73,7 +73,7 @@ const nextDev: cliCommand = (argv) => {
) { ) {
Log.warn( Log.warn(
'React 17.0.1 or newer will be required to leverage all of the upcoming features in Next.js 11.' + 'React 17.0.1 or newer will be required to leverage all of the upcoming features in Next.js 11.' +
' Read more: https://err.sh/next.js/react-version' ' Read more: https://nextjs.org/docs/messages/react-version'
) )
} else { } else {
const reactDomVersion: string | null = await getPackageVersion({ const reactDomVersion: string | null = await getPackageVersion({
...@@ -87,7 +87,7 @@ const nextDev: cliCommand = (argv) => { ...@@ -87,7 +87,7 @@ const nextDev: cliCommand = (argv) => {
) { ) {
Log.warn( Log.warn(
'React 17.0.1 or newer will be required to leverage all of the upcoming features in Next.js 11.' + 'React 17.0.1 or newer will be required to leverage all of the upcoming features in Next.js 11.' +
' Read more: https://err.sh/next.js/react-version' ' Read more: https://nextjs.org/docs/messages/react-version'
) )
} }
} }
...@@ -100,7 +100,7 @@ const nextDev: cliCommand = (argv) => { ...@@ -100,7 +100,7 @@ const nextDev: cliCommand = (argv) => {
Log.warn( Log.warn(
'Your project has both `sass` and `node-sass` installed as dependencies, but should only use one or the other. ' + 'Your project has both `sass` and `node-sass` installed as dependencies, but should only use one or the other. ' +
'Please remove the `node-sass` dependency from your project. ' + 'Please remove the `node-sass` dependency from your project. ' +
' Read more: https://err.sh/next.js/duplicate-sass' ' Read more: https://nextjs.org/docs/messages/duplicate-sass'
) )
} }
} }
......
...@@ -105,7 +105,7 @@ function formatMessage(message) { ...@@ -105,7 +105,7 @@ function formatMessage(message) {
lines[1] = lines[1] =
"To use Next.js' built-in Sass support, you first need to install `sass`.\n" "To use Next.js' built-in Sass support, you first need to install `sass`.\n"
lines[1] += 'Run `npm i sass` or `yarn add sass` inside your workspace.\n' lines[1] += 'Run `npm i sass` or `yarn add sass` inside your workspace.\n'
lines[1] += '\nLearn more: https://err.sh/next.js/install-sass' lines[1] += '\nLearn more: https://nextjs.org/docs/messages/install-sass'
} }
message = lines.join('\n') message = lines.join('\n')
......
...@@ -48,7 +48,7 @@ function updateElements(type: string, components: JSX.Element[]): void { ...@@ -48,7 +48,7 @@ function updateElements(type: string, components: JSX.Element[]): void {
if (process.env.NODE_ENV !== 'production') { if (process.env.NODE_ENV !== 'production') {
if (!headCountEl) { if (!headCountEl) {
console.error( console.error(
'Warning: next-head-count is missing. https://err.sh/next.js/next-head-count-missing' 'Warning: next-head-count is missing. https://nextjs.org/docs/messages/next-head-count-missing'
) )
return return
} }
......
...@@ -577,7 +577,7 @@ function defaultLoader({ ...@@ -577,7 +577,7 @@ function defaultLoader({
if (!configDomains.includes(parsedSrc.hostname)) { if (!configDomains.includes(parsedSrc.hostname)) {
throw new Error( throw new Error(
`Invalid src prop (${src}) on \`next/image\`, hostname "${parsedSrc.hostname}" is not configured under images in your \`next.config.js\`\n` + `Invalid src prop (${src}) on \`next/image\`, hostname "${parsedSrc.hostname}" is not configured under images in your \`next.config.js\`\n` +
`See more info: https://err.sh/next.js/next-image-unconfigured-host` `See more info: https://nextjs.org/docs/messages/next-image-unconfigured-host`
) )
} }
} }
......
...@@ -206,7 +206,7 @@ function Link(props: React.PropsWithChildren<LinkProps>) { ...@@ -206,7 +206,7 @@ function Link(props: React.PropsWithChildren<LinkProps>) {
if (props.prefetch && !hasWarned.current) { if (props.prefetch && !hasWarned.current) {
hasWarned.current = true hasWarned.current = true
console.warn( console.warn(
'Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://err.sh/vercel/next.js/prefetch-true-deprecated' 'Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://nextjs.org/docs/messages/prefetch-true-deprecated'
) )
} }
} }
......
...@@ -181,7 +181,7 @@ export default async function exportApp( ...@@ -181,7 +181,7 @@ export default async function exportApp(
if (!existsSync(buildIdFile)) { if (!existsSync(buildIdFile)) {
throw new Error( throw new Error(
`Could not find a production build in the '${distDir}' directory. Try building your app with 'next build' before starting the static export. https://err.sh/vercel/next.js/next-export-no-build-id` `Could not find a production build in the '${distDir}' directory. Try building your app with 'next build' before starting the static export. https://nextjs.org/docs/messages/next-export-no-build-id`
) )
} }
...@@ -197,7 +197,7 @@ export default async function exportApp( ...@@ -197,7 +197,7 @@ export default async function exportApp(
Log.warn( Log.warn(
`rewrites, redirects, and headers are not applied when exporting your application, detected (${customRoutesDetected.join( `rewrites, redirects, and headers are not applied when exporting your application, detected (${customRoutesDetected.join(
', ' ', '
)}). See more info here: https://err.sh/next.js/export-no-custom-routes` )}). See more info here: https://nextjs.org/docs/messages/export-no-custom-routes`
) )
} }
...@@ -251,13 +251,13 @@ export default async function exportApp( ...@@ -251,13 +251,13 @@ export default async function exportApp(
if (outDir === join(dir, 'public')) { if (outDir === join(dir, 'public')) {
throw new Error( throw new Error(
`The 'public' directory is reserved in Next.js and can not be used as the export out directory. https://err.sh/vercel/next.js/can-not-output-to-public` `The 'public' directory is reserved in Next.js and can not be used as the export out directory. https://nextjs.org/docs/messages/can-not-output-to-public`
) )
} }
if (outDir === join(dir, 'static')) { if (outDir === join(dir, 'static')) {
throw new Error( throw new Error(
`The 'static' directory is reserved in Next.js and can not be used as the export out directory. https://err.sh/vercel/next.js/can-not-output-to-static` `The 'static' directory is reserved in Next.js and can not be used as the export out directory. https://nextjs.org/docs/messages/can-not-output-to-static`
) )
} }
...@@ -345,7 +345,7 @@ export default async function exportApp( ...@@ -345,7 +345,7 @@ export default async function exportApp(
- Use any provider which supports Image Optimization (like Vercel). - Use any provider which supports Image Optimization (like Vercel).
- Configure a third-party loader in \`next.config.js\`. - Configure a third-party loader in \`next.config.js\`.
- Use the \`loader\` prop for \`next/image\`. - Use the \`loader\` prop for \`next/image\`.
Read more: https://err.sh/next.js/export-image-api` Read more: https://nextjs.org/docs/messages/export-image-api`
) )
} }
} }
...@@ -467,7 +467,7 @@ export default async function exportApp( ...@@ -467,7 +467,7 @@ export default async function exportApp(
) + ) +
`\n` + `\n` +
chalk.yellow( chalk.yellow(
`Learn more: https://err.sh/vercel/next.js/api-routes-static-export` `Learn more: https://nextjs.org/docs/messages/api-routes-static-export`
) )
) )
} }
...@@ -619,7 +619,7 @@ export default async function exportApp( ...@@ -619,7 +619,7 @@ export default async function exportApp(
} }
if (hadValidationError) { if (hadValidationError) {
throw new Error( throw new Error(
`AMP Validation caused the export to fail. https://err.sh/vercel/next.js/amp-export-validation` `AMP Validation caused the export to fail. https://nextjs.org/docs/messages/amp-export-validation`
) )
} }
......
...@@ -159,7 +159,7 @@ export default async function exportPage({ ...@@ -159,7 +159,7 @@ export default async function exportPage({
} }
} else { } else {
throw new Error( throw new Error(
`The provided export path '${updatedPath}' doesn't match the '${page}' page.\nRead more: https://err.sh/vercel/next.js/export-path-mismatch` `The provided export path '${updatedPath}' doesn't match the '${page}' page.\nRead more: https://nextjs.org/docs/messages/export-path-mismatch`
) )
} }
} }
...@@ -451,7 +451,7 @@ export default async function exportPage({ ...@@ -451,7 +451,7 @@ export default async function exportPage({
return results return results
} catch (error) { } catch (error) {
console.error( console.error(
`\nError occurred prerendering page "${path}". Read more: https://err.sh/next.js/prerender-error\n` + `\nError occurred prerendering page "${path}". Read more: https://nextjs.org/docs/messages/prerender-error\n` +
error.stack error.stack
) )
return { ...results, error: true } return { ...results, error: true }
......
...@@ -22,7 +22,7 @@ export const API_ROUTE = /^\/api(?:\/|$)/ ...@@ -22,7 +22,7 @@ export const API_ROUTE = /^\/api(?:\/|$)/
export const PAGES_DIR_ALIAS = 'private-next-pages' export const PAGES_DIR_ALIAS = 'private-next-pages'
export const DOT_NEXT_ALIAS = 'private-dot-next' export const DOT_NEXT_ALIAS = 'private-dot-next'
export const PUBLIC_DIR_MIDDLEWARE_CONFLICT = `You can not have a '_next' folder inside of your public folder. This conflicts with the internal '/_next' route. https://err.sh/vercel/next.js/public-next-folder-conflict` export const PUBLIC_DIR_MIDDLEWARE_CONFLICT = `You can not have a '_next' folder inside of your public folder. This conflicts with the internal '/_next' route. https://nextjs.org/docs/messages/public-next-folder-conflict`
export const SSG_GET_INITIAL_PROPS_CONFLICT = `You can not use getInitialProps with getStaticProps. To use SSG, please remove your getInitialProps` export const SSG_GET_INITIAL_PROPS_CONFLICT = `You can not use getInitialProps with getStaticProps. To use SSG, please remove your getInitialProps`
...@@ -30,9 +30,9 @@ export const SERVER_PROPS_GET_INIT_PROPS_CONFLICT = `You can not use getInitialP ...@@ -30,9 +30,9 @@ export const SERVER_PROPS_GET_INIT_PROPS_CONFLICT = `You can not use getInitialP
export const SERVER_PROPS_SSG_CONFLICT = `You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps` export const SERVER_PROPS_SSG_CONFLICT = `You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps`
export const STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR = `can not have getInitialProps/getServerSideProps, https://err.sh/next.js/404-get-initial-props` export const STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR = `can not have getInitialProps/getServerSideProps, https://nextjs.org/docs/messages/404-get-initial-props`
export const SERVER_PROPS_EXPORT_ERROR = `pages with \`getServerSideProps\` can not be exported. See more info here: https://err.sh/next.js/gssp-export` export const SERVER_PROPS_EXPORT_ERROR = `pages with \`getServerSideProps\` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export`
export const GSP_NO_RETURNED_VALUE = export const GSP_NO_RETURNED_VALUE =
'Your `getStaticProps` function did not return an object. Did you forget to add a `return`?' 'Your `getStaticProps` function did not return an object. Did you forget to add a `return`?'
...@@ -43,8 +43,8 @@ export const UNSTABLE_REVALIDATE_RENAME_ERROR = ...@@ -43,8 +43,8 @@ export const UNSTABLE_REVALIDATE_RENAME_ERROR =
'The `unstable_revalidate` property is available for general use.\n' + 'The `unstable_revalidate` property is available for general use.\n' +
'Please use `revalidate` instead.' 'Please use `revalidate` instead.'
export const GSSP_COMPONENT_MEMBER_ERROR = `can not be attached to a page's component and must be exported from the page. See more info here: https://err.sh/next.js/gssp-component-member` export const GSSP_COMPONENT_MEMBER_ERROR = `can not be attached to a page's component and must be exported from the page. See more info here: https://nextjs.org/docs/messages/gssp-component-member`
export const NON_STANDARD_NODE_ENV = `You are using a non-standard "NODE_ENV" value in your environment. This creates inconsistencies in the project and is strongly advised against. Read more: https://err.sh/next.js/non-standard-node-env` export const NON_STANDARD_NODE_ENV = `You are using a non-standard "NODE_ENV" value in your environment. This creates inconsistencies in the project and is strongly advised against. Read more: https://nextjs.org/docs/messages/non-standard-node-env`
export const SSG_FALLBACK_EXPORT_ERROR = `Pages with \`fallback\` enabled in \`getStaticPaths\` can not be exported. See more info here: https://err.sh/next.js/ssg-fallback-true-export` export const SSG_FALLBACK_EXPORT_ERROR = `Pages with \`fallback\` enabled in \`getStaticPaths\` can not be exported. See more info here: https://nextjs.org/docs/messages/ssg-fallback-true-export`
...@@ -133,21 +133,21 @@ function tryParsePath(route: string, handleUrl?: boolean): ParseAttemptResult { ...@@ -133,21 +133,21 @@ function tryParsePath(route: string, handleUrl?: boolean): ParseAttemptResult {
result.tokens = pathToRegexp.parse(routePath) result.tokens = pathToRegexp.parse(routePath)
pathToRegexp.tokensToRegexp(result.tokens) pathToRegexp.tokensToRegexp(result.tokens)
} catch (err) { } catch (err) {
// If there is an error show our err.sh but still show original error or a formatted one if we can // If there is an error show our error link but still show original error or a formatted one if we can
const errMatches = err.message.match(/at (\d{0,})/) const errMatches = err.message.match(/at (\d{0,})/)
if (errMatches) { if (errMatches) {
const position = parseInt(errMatches[1], 10) const position = parseInt(errMatches[1], 10)
console.error( console.error(
`\nError parsing \`${route}\` ` + `\nError parsing \`${route}\` ` +
`https://err.sh/vercel/next.js/invalid-route-source\n` + `https://nextjs.org/docs/messages/invalid-route-source\n` +
`Reason: ${err.message}\n\n` + `Reason: ${err.message}\n\n` +
` ${routePath}\n` + ` ${routePath}\n` +
` ${new Array(position).fill(' ').join('')}^\n` ` ${new Array(position).fill(' ').join('')}^\n`
) )
} else { } else {
console.error( console.error(
`\nError parsing ${route} https://err.sh/vercel/next.js/invalid-route-source`, `\nError parsing ${route} https://nextjs.org/docs/messages/invalid-route-source`,
err err
) )
} }
...@@ -172,7 +172,7 @@ function checkCustomRoutes( ...@@ -172,7 +172,7 @@ function checkCustomRoutes(
if (!Array.isArray(routes)) { if (!Array.isArray(routes)) {
throw new Error( throw new Error(
`${type}s must return an array, received ${typeof routes}.\n` + `${type}s must return an array, received ${typeof routes}.\n` +
`See here for more info: https://err.sh/next.js/routes-must-be-array` `See here for more info: https://nextjs.org/docs/messages/routes-must-be-array`
) )
} }
...@@ -218,7 +218,7 @@ function checkCustomRoutes( ...@@ -218,7 +218,7 @@ function checkCustomRoutes(
console.error( console.error(
`The route ${ `The route ${
(route as Rewrite).source (route as Rewrite).source
} rewrites urls outside of the basePath. Please use a destination that starts with \`http://\` or \`https://\` https://err.sh/vercel/next.js/invalid-external-rewrite` } rewrites urls outside of the basePath. Please use a destination that starts with \`http://\` or \`https://\` https://nextjs.org/docs/messages/invalid-external-rewrite`
) )
numInvalidRoutes++ numInvalidRoutes++
continue continue
......
...@@ -125,7 +125,7 @@ export default function dynamic<P = {}>( ...@@ -125,7 +125,7 @@ export default function dynamic<P = {}>(
if (process.env.NODE_ENV !== 'production') { if (process.env.NODE_ENV !== 'production') {
if (dynamicOptions.modules) { if (dynamicOptions.modules) {
console.warn( console.warn(
'The modules option for next/dynamic has been deprecated. See here for more info https://err.sh/vercel/next.js/next-dynamic-modules' 'The modules option for next/dynamic has been deprecated. See here for more info https://nextjs.org/docs/messages/next-dynamic-modules'
) )
} }
} }
......
...@@ -993,7 +993,7 @@ export default class Router implements BaseRouter { ...@@ -993,7 +993,7 @@ export default class Router implements BaseRouter {
if (process.env.NODE_ENV !== 'production') { if (process.env.NODE_ENV !== 'production') {
throw new Error( throw new Error(
`Invalid href: "${url}" and as: "${as}", received relative href and external as` + `Invalid href: "${url}" and as: "${as}", received relative href and external as` +
`\nSee more info: https://err.sh/next.js/invalid-relative-url-external-as` `\nSee more info: https://nextjs.org/docs/messages/invalid-relative-url-external-as`
) )
} }
...@@ -1039,7 +1039,7 @@ export default class Router implements BaseRouter { ...@@ -1039,7 +1039,7 @@ export default class Router implements BaseRouter {
', ' ', '
)}) to be interpolated properly. ` )}) to be interpolated properly. `
: `The provided \`as\` value (${asPathname}) is incompatible with the \`href\` value (${route}). `) + : `The provided \`as\` value (${asPathname}) is incompatible with the \`href\` value (${route}). `) +
`Read more: https://err.sh/vercel/next.js/${ `Read more: https://nextjs.org/docs/messages/${
shouldInterpolate shouldInterpolate
? 'href-interpolation-failed' ? 'href-interpolation-failed'
: 'incompatible-href-as' : 'incompatible-href-as'
......
...@@ -236,7 +236,7 @@ export default function prepareDestination( ...@@ -236,7 +236,7 @@ export default function prepareDestination(
} catch (err) { } catch (err) {
if (err.message.match(/Expected .*? to not repeat, but got an array/)) { if (err.message.match(/Expected .*? to not repeat, but got an array/)) {
throw new Error( throw new Error(
`To use a multi-match in the destination you must add \`*\` at the end of the param name to signify it should repeat. https://err.sh/vercel/next.js/invalid-multi-match` `To use a multi-match in the destination you must add \`*\` at the end of the param name to signify it should repeat. https://nextjs.org/docs/messages/invalid-multi-match`
) )
} }
throw err throw err
......
...@@ -120,7 +120,7 @@ class UrlNode { ...@@ -120,7 +120,7 @@ class UrlNode {
// pages/[id]/index.js // pages/[id]/index.js
// Because currently multiple dynamic params on the same segment level are not supported // Because currently multiple dynamic params on the same segment level are not supported
if (previousSlug !== nextSlug) { if (previousSlug !== nextSlug) {
// TODO: This error seems to be confusing for users, needs an err.sh link, the description can be based on above comment. // TODO: This error seems to be confusing for users, needs an error link, the description can be based on above comment.
throw new Error( throw new Error(
`You cannot use different slug names for the same dynamic path ('${previousSlug}' !== '${nextSlug}').` `You cannot use different slug names for the same dynamic path ('${previousSlug}' !== '${nextSlug}').`
) )
......
...@@ -318,7 +318,7 @@ export async function loadGetInitialProps< ...@@ -318,7 +318,7 @@ export async function loadGetInitialProps<
if (App.prototype?.getInitialProps) { if (App.prototype?.getInitialProps) {
const message = `"${getDisplayName( const message = `"${getDisplayName(
App App
)}.getInitialProps()" is defined as an instance method - visit https://err.sh/vercel/next.js/get-initial-props-as-an-instance-method for more information.` )}.getInitialProps()" is defined as an instance method - visit https://nextjs.org/docs/messages/get-initial-props-as-an-instance-method for more information.`
throw new Error(message) throw new Error(message)
} }
} }
...@@ -353,7 +353,7 @@ export async function loadGetInitialProps< ...@@ -353,7 +353,7 @@ export async function loadGetInitialProps<
console.warn( console.warn(
`${getDisplayName( `${getDisplayName(
App App
)} returned an empty object from \`getInitialProps\`. This de-optimizes and prevents automatic static optimization. https://err.sh/vercel/next.js/empty-object-getInitialProps` )} returned an empty object from \`getInitialProps\`. This de-optimizes and prevents automatic static optimization. https://nextjs.org/docs/messages/empty-object-getInitialProps`
) )
} }
} }
......
...@@ -134,7 +134,7 @@ export function normalizeConfig(phase: string, config: any) { ...@@ -134,7 +134,7 @@ export function normalizeConfig(phase: string, config: any) {
if (typeof config.then === 'function') { if (typeof config.then === 'function') {
throw new Error( throw new Error(
'> Promise returned in next config. https://err.sh/vercel/next.js/promise-in-next-config' '> Promise returned in next config. https://nextjs.org/docs/messages/promise-in-next-config'
) )
} }
} }
......
This diff is collapsed.
...@@ -1253,7 +1253,7 @@ export default class Server { ...@@ -1253,7 +1253,7 @@ export default class Server {
): Promise<void> { ): Promise<void> {
if (!pathname.startsWith('/')) { if (!pathname.startsWith('/')) {
console.warn( console.warn(
`Cannot render page with path "${pathname}", did you mean "/${pathname}"?. See more info here: https://err.sh/next.js/render-no-starting-slash` `Cannot render page with path "${pathname}", did you mean "/${pathname}"?. See more info here: https://nextjs.org/docs/messages/render-no-starting-slash`
) )
} }
...@@ -1933,7 +1933,7 @@ export default class Server { ...@@ -1933,7 +1933,7 @@ export default class Server {
console.warn( console.warn(
chalk.bold.yellow(`Warning: `) + chalk.bold.yellow(`Warning: `) +
chalk.yellow( chalk.yellow(
`You have added a custom /_error page without a custom /404 page. This prevents the 404 page from being auto statically optimized.\nSee here for info: https://err.sh/next.js/custom-error-no-custom-404` `You have added a custom /_error page without a custom /404 page. This prevents the 404 page from being auto statically optimized.\nSee here for info: https://nextjs.org/docs/messages/custom-error-no-custom-404`
) )
) )
}) })
...@@ -2133,7 +2133,7 @@ export default class Server { ...@@ -2133,7 +2133,7 @@ export default class Server {
} catch (err) { } catch (err) {
if (!fs.existsSync(buildIdFile)) { if (!fs.existsSync(buildIdFile)) {
throw new Error( throw new Error(
`Could not find a production build in the '${this.distDir}' directory. Try building your app with 'next build' before starting the production server. https://err.sh/vercel/next.js/production-start-no-build-id` `Could not find a production build in the '${this.distDir}' directory. Try building your app with 'next build' before starting the production server. https://nextjs.org/docs/messages/production-start-no-build-id`
) )
} }
......
...@@ -64,7 +64,7 @@ import { DomainLocales } from './config' ...@@ -64,7 +64,7 @@ import { DomainLocales } from './config'
function noRouter() { function noRouter() {
const message = const message =
'No router instance found. you should only use "next/router" inside the client side of your app. https://err.sh/vercel/next.js/no-router-instance' 'No router instance found. you should only use "next/router" inside the client side of your app. https://nextjs.org/docs/messages/no-router-instance'
throw new Error(message) throw new Error(message)
} }
...@@ -320,7 +320,7 @@ const invalidKeysMsg = (methodName: string, invalidKeys: string[]) => { ...@@ -320,7 +320,7 @@ const invalidKeysMsg = (methodName: string, invalidKeys: string[]) => {
`Additional keys were returned from \`${methodName}\`. Properties intended for your component must be nested under the \`props\` key, e.g.:` + `Additional keys were returned from \`${methodName}\`. Properties intended for your component must be nested under the \`props\` key, e.g.:` +
`\n\n\treturn { props: { title: 'My Title', content: '...' } }` + `\n\n\treturn { props: { title: 'My Title', content: '...' } }` +
`\n\nKeys that need to be moved: ${invalidKeys.join(', ')}.` + `\n\nKeys that need to be moved: ${invalidKeys.join(', ')}.` +
`\nRead more: https://err.sh/next.js/invalid-getstaticprops-value` `\nRead more: https://nextjs.org/docs/messages/invalid-getstaticprops-value`
) )
} }
...@@ -367,7 +367,7 @@ function checkRedirectValues( ...@@ -367,7 +367,7 @@ function checkRedirectValues(
`Invalid redirect object returned from ${method} for ${req.url}\n` + `Invalid redirect object returned from ${method} for ${req.url}\n` +
errors.join(' and ') + errors.join(' and ') +
'\n' + '\n' +
`See more info here: https://err.sh/vercel/next.js/invalid-redirect-gssp` `See more info here: https://nextjs.org/docs/messages/invalid-redirect-gssp`
) )
} }
} }
...@@ -495,7 +495,7 @@ export async function renderToHTML( ...@@ -495,7 +495,7 @@ export async function renderToHTML(
if (isSSG && pageIsDynamic && !getStaticPaths) { if (isSSG && pageIsDynamic && !getStaticPaths) {
throw new Error( throw new Error(
`getStaticPaths is required for dynamic SSG pages and is missing for '${pathname}'.` + `getStaticPaths is required for dynamic SSG pages and is missing for '${pathname}'.` +
`\nRead more: https://err.sh/next.js/invalid-getstaticpaths-value` `\nRead more: https://nextjs.org/docs/messages/invalid-getstaticpaths-value`
) )
} }
...@@ -707,7 +707,7 @@ export async function renderToHTML( ...@@ -707,7 +707,7 @@ export async function renderToHTML(
throw new Error( throw new Error(
`\`redirect\` and \`notFound\` can not both be returned from ${ `\`redirect\` and \`notFound\` can not both be returned from ${
isSSG ? 'getStaticProps' : 'getServerSideProps' isSSG ? 'getStaticProps' : 'getServerSideProps'
} at the same time. Page: ${pathname}\nSee more info here: https://err.sh/next.js/gssp-mixed-not-found-redirect` } at the same time. Page: ${pathname}\nSee more info here: https://nextjs.org/docs/messages/gssp-mixed-not-found-redirect`
) )
} }
} }
...@@ -732,7 +732,7 @@ export async function renderToHTML( ...@@ -732,7 +732,7 @@ export async function renderToHTML(
if (isBuildTimeSSG) { if (isBuildTimeSSG) {
throw new Error( throw new Error(
`\`redirect\` can not be returned from getStaticProps during prerendering (${req.url})\n` + `\`redirect\` can not be returned from getStaticProps during prerendering (${req.url})\n` +
`See more info here: https://err.sh/next.js/gsp-redirect-during-prerender` `See more info here: https://nextjs.org/docs/messages/gsp-redirect-during-prerender`
) )
} }
...@@ -934,7 +934,7 @@ export async function renderToHTML( ...@@ -934,7 +934,7 @@ export async function renderToHTML(
) { ) {
console.warn( console.warn(
`The prop \`url\` is a reserved prop in Next.js for legacy reasons and will be overridden on page ${pathname}\n` + `The prop \`url\` is a reserved prop in Next.js for legacy reasons and will be overridden on page ${pathname}\n` +
`See more info here: https://err.sh/vercel/next.js/reserved-page-prop` `See more info here: https://nextjs.org/docs/messages/reserved-page-prop`
) )
} }
...@@ -989,7 +989,7 @@ export async function renderToHTML( ...@@ -989,7 +989,7 @@ export async function renderToHTML(
if (dev && (props.router || props.Component)) { if (dev && (props.router || props.Component)) {
throw new Error( throw new Error(
`'router' and 'Component' can not be returned in getInitialProps from _app.js https://err.sh/vercel/next.js/cant-override-next-props` `'router' and 'Component' can not be returned in getInitialProps from _app.js https://nextjs.org/docs/messages/cant-override-next-props`
) )
} }
...@@ -1098,7 +1098,7 @@ export async function renderToHTML( ...@@ -1098,7 +1098,7 @@ export async function renderToHTML(
warn( warn(
`Your custom Document (pages/_document) did not render all the required subcomponent${plural}.\n` + `Your custom Document (pages/_document) did not render all the required subcomponent${plural}.\n` +
`Missing component${plural}: ${missingComponentList}\n` + `Missing component${plural}: ${missingComponentList}\n` +
'Read how to fix here: https://err.sh/next.js/missing-document-component' 'Read how to fix here: https://nextjs.org/docs/messages/missing-document-component'
) )
} }
} }
......
...@@ -66,13 +66,13 @@ let warnUrl: () => void ...@@ -66,13 +66,13 @@ let warnUrl: () => void
if (process.env.NODE_ENV !== 'production') { if (process.env.NODE_ENV !== 'production') {
warnContainer = execOnce(() => { warnContainer = execOnce(() => {
console.warn( console.warn(
`Warning: the \`Container\` in \`_app\` has been deprecated and should be removed. https://err.sh/vercel/next.js/app-container-deprecated` `Warning: the \`Container\` in \`_app\` has been deprecated and should be removed. https://nextjs.org/docs/messages/app-container-deprecated`
) )
}) })
warnUrl = execOnce(() => { warnUrl = execOnce(() => {
console.error( console.error(
`Warning: the 'url' property is deprecated. https://err.sh/vercel/next.js/url-deprecated` `Warning: the 'url' property is deprecated. https://nextjs.org/docs/messages/url-deprecated`
) )
}) })
} }
......
...@@ -406,14 +406,14 @@ export class Head extends Component< ...@@ -406,14 +406,14 @@ export class Head extends Component<
if (!isReactHelmet) { if (!isReactHelmet) {
if (child?.type === 'title') { if (child?.type === 'title') {
console.warn( console.warn(
"Warning: <title> should not be used in _document.js's <Head>. https://err.sh/next.js/no-document-title" "Warning: <title> should not be used in _document.js's <Head>. https://nextjs.org/docs/messages/no-document-title"
) )
} else if ( } else if (
child?.type === 'meta' && child?.type === 'meta' &&
child?.props?.name === 'viewport' child?.props?.name === 'viewport'
) { ) {
console.warn( console.warn(
"Warning: viewport meta tags should not be used in _document.js's <Head>. https://err.sh/next.js/no-document-viewport-meta" "Warning: viewport meta tags should not be used in _document.js's <Head>. https://nextjs.org/docs/messages/no-document-viewport-meta"
) )
} }
} }
...@@ -421,7 +421,7 @@ export class Head extends Component< ...@@ -421,7 +421,7 @@ export class Head extends Component<
}) })
if (this.props.crossOrigin) if (this.props.crossOrigin)
console.warn( console.warn(
'Warning: `Head` attribute `crossOrigin` is deprecated. https://err.sh/next.js/doc-crossorigin-deprecated' 'Warning: `Head` attribute `crossOrigin` is deprecated. https://nextjs.org/docs/messages/doc-crossorigin-deprecated'
) )
} }
...@@ -471,7 +471,7 @@ export class Head extends Component< ...@@ -471,7 +471,7 @@ export class Head extends Component<
if (badProp) { if (badProp) {
console.warn( console.warn(
`Found conflicting amp tag "${child.type}" with conflicting prop ${badProp} in ${__NEXT_DATA__.page}. https://err.sh/next.js/conflicting-amp-tag` `Found conflicting amp tag "${child.type}" with conflicting prop ${badProp} in ${__NEXT_DATA__.page}. https://nextjs.org/docs/messages/conflicting-amp-tag`
) )
return null return null
} }
...@@ -763,7 +763,7 @@ export class NextScript extends Component<OriginProps> { ...@@ -763,7 +763,7 @@ export class NextScript extends Component<OriginProps> {
} catch (err) { } catch (err) {
if (err.message.indexOf('circular structure')) { if (err.message.indexOf('circular structure')) {
throw new Error( throw new Error(
`Circular structure in "getInitialProps" result of page "${__NEXT_DATA__.page}". https://err.sh/vercel/next.js/circular-structure` `Circular structure in "getInitialProps" result of page "${__NEXT_DATA__.page}". https://nextjs.org/docs/messages/circular-structure`
) )
} }
throw err throw err
...@@ -828,7 +828,7 @@ export class NextScript extends Component<OriginProps> { ...@@ -828,7 +828,7 @@ export class NextScript extends Component<OriginProps> {
if (process.env.NODE_ENV !== 'production') { if (process.env.NODE_ENV !== 'production') {
if (this.props.crossOrigin) if (this.props.crossOrigin)
console.warn( console.warn(
'Warning: `NextScript` attribute `crossOrigin` is deprecated. https://err.sh/next.js/doc-crossorigin-deprecated' 'Warning: `NextScript` attribute `crossOrigin` is deprecated. https://nextjs.org/docs/messages/doc-crossorigin-deprecated'
) )
} }
......
...@@ -43,7 +43,7 @@ import { NextConfig } from '../next-server/server/config' ...@@ -43,7 +43,7 @@ import { NextConfig } from '../next-server/server/config'
if (typeof React.Suspense === 'undefined') { if (typeof React.Suspense === 'undefined') {
throw new Error( throw new Error(
`The version of React you are using is lower than the minimum required version needed for Next.js. Please upgrade "react" and "react-dom": "npm install react react-dom" https://err.sh/vercel/next.js/invalid-react-version` `The version of React you are using is lower than the minimum required version needed for Next.js. Please upgrade "react" and "react-dom": "npm install react react-dom" https://nextjs.org/docs/messages/invalid-react-version`
) )
} }
...@@ -94,7 +94,7 @@ export default class DevServer extends Server { ...@@ -94,7 +94,7 @@ export default class DevServer extends Server {
} }
if (fs.existsSync(pathJoin(this.dir, 'static'))) { if (fs.existsSync(pathJoin(this.dir, 'static'))) {
console.warn( console.warn(
`The static directory has been deprecated in favor of the public directory. https://err.sh/vercel/next.js/static-dir-deprecated` `The static directory has been deprecated in favor of the public directory. https://nextjs.org/docs/messages/static-dir-deprecated`
) )
} }
this.isCustomServer = !options.isNextDevCommand this.isCustomServer = !options.isNextDevCommand
...@@ -362,7 +362,7 @@ export default class DevServer extends Server { ...@@ -362,7 +362,7 @@ export default class DevServer extends Server {
if (await this.hasPublicFile(decodedPath)) { if (await this.hasPublicFile(decodedPath)) {
if (await this.hasPage(pathname!)) { if (await this.hasPage(pathname!)) {
const err = new Error( const err = new Error(
`A conflicting public file and page file was found for path ${pathname} https://err.sh/vercel/next.js/conflicting-public-file-page` `A conflicting public file and page file was found for path ${pathname} https://nextjs.org/docs/messages/conflicting-public-file-page`
) )
res.statusCode = 500 res.statusCode = 500
await this.renderError(err, req, res, pathname!, {}) await this.renderError(err, req, res, pathname!, {})
...@@ -662,7 +662,7 @@ export default class DevServer extends Server { ...@@ -662,7 +662,7 @@ export default class DevServer extends Server {
if (!err && res.statusCode === 500) { if (!err && res.statusCode === 500) {
err = new Error( err = new Error(
'An undefined error was thrown sometime during render... ' + 'An undefined error was thrown sometime during render... ' +
'See https://err.sh/vercel/next.js/threw-undefined' 'See https://nextjs.org/docs/messages/threw-undefined'
) )
} }
......
...@@ -148,7 +148,7 @@ function createServer(options: NextServerConstructor): NextServer { ...@@ -148,7 +148,7 @@ function createServer(options: NextServerConstructor): NextServer {
if (options == null) { if (options == null) {
throw new Error( throw new Error(
'The server has not been instantiated properly. https://err.sh/next.js/invalid-server-options' 'The server has not been instantiated properly. https://nextjs.org/docs/messages/invalid-server-options'
) )
} }
...@@ -163,7 +163,7 @@ function createServer(options: NextServerConstructor): NextServer { ...@@ -163,7 +163,7 @@ function createServer(options: NextServerConstructor): NextServer {
if (options.dev) { if (options.dev) {
if (typeof options.dev !== 'boolean') { if (typeof options.dev !== 'boolean') {
console.warn( console.warn(
"Warning: 'dev' is not a boolean which could introduce unexpected behavior. https://err.sh/next.js/invalid-server-options" "Warning: 'dev' is not a boolean which could introduce unexpected behavior. https://nextjs.org/docs/messages/invalid-server-options"
) )
} }
} }
......
...@@ -456,7 +456,7 @@ function runTests(dev = false) { ...@@ -456,7 +456,7 @@ function runTests(dev = false) {
{ stderr: true } { stderr: true }
) )
expect(stderr).toContain( expect(stderr).toContain(
'https://err.sh/vercel/next.js/api-routes-static-export' 'https://nextjs.org/docs/messages/api-routes-static-export'
) )
}) })
......
...@@ -257,7 +257,7 @@ export default function (render, fetch, ctx) { ...@@ -257,7 +257,7 @@ export default function (render, fetch, ctx) {
) )
const expectedErrorMessage = const expectedErrorMessage =
'"InstanceInitialPropsPage.getInitialProps()" is defined as an instance method - visit https://err.sh/vercel/next.js/get-initial-props-as-an-instance-method for more information.' '"InstanceInitialPropsPage.getInitialProps()" is defined as an instance method - visit https://nextjs.org/docs/messages/get-initial-props-as-an-instance-method for more information.'
expect(await hasRedbox(browser)).toBe(true) expect(await hasRedbox(browser)).toBe(true)
const text = await getRedboxHeader(browser) const text = await getRedboxHeader(browser)
......
...@@ -21,7 +21,7 @@ describe('Empty configuration', () => { ...@@ -21,7 +21,7 @@ describe('Empty configuration', () => {
}) })
expect(stdout).toMatch(/Compiled successfully/) expect(stdout).toMatch(/Compiled successfully/)
expect(stderr).toMatch( expect(stderr).toMatch(
/Detected next\.config\.js, no exported configuration found\. https:\/\/err\.sh\/vercel\/next\.js\/empty-configuration/ /Detected next\.config\.js, no exported configuration found\. https:\/\//
) )
}) })
...@@ -38,7 +38,7 @@ describe('Empty configuration', () => { ...@@ -38,7 +38,7 @@ describe('Empty configuration', () => {
await killApp(app) await killApp(app)
expect(stderr).toMatch( expect(stderr).toMatch(
/Detected next\.config\.js, no exported configuration found\. https:\/\/err\.sh\/vercel\/next\.js\/empty-configuration/ /Detected next\.config\.js, no exported configuration found\. https:\/\//
) )
}) })
}) })
...@@ -24,7 +24,7 @@ describe('Promise in next config', () => { ...@@ -24,7 +24,7 @@ describe('Promise in next config', () => {
) )
expect(stderr).toMatch( expect(stderr).toMatch(
/Error: > Promise returned in next config\. https:\/\/err\.sh\/vercel\/next\.js\/promise-in-next-config/ /Error: > Promise returned in next config\. https:\/\//
) )
}) })
...@@ -45,8 +45,6 @@ describe('Promise in next config', () => { ...@@ -45,8 +45,6 @@ describe('Promise in next config', () => {
{ stderr: true } { stderr: true }
) )
expect(stderr).toMatch( expect(stderr).toMatch(/> Promise returned in next config\. https:\/\//)
/> Promise returned in next config\. https:\/\/err\.sh\/vercel\/next\.js\/promise-in-next-config/
)
}) })
}) })
...@@ -12,7 +12,7 @@ describe('Invalid resolve alias', () => { ...@@ -12,7 +12,7 @@ describe('Invalid resolve alias', () => {
}) })
expect(stderr).toMatch( expect(stderr).toMatch(
'webpack config.resolve.alias was incorrectly overridden. https://err.sh' 'webpack config.resolve.alias was incorrectly overridden. https://'
) )
}) })
}) })
...@@ -72,7 +72,9 @@ describe('Conflicting SSG paths', () => { ...@@ -72,7 +72,9 @@ describe('Conflicting SSG paths', () => {
expect(output).toContain( expect(output).toContain(
'Conflicting paths returned from getStaticPaths, paths must unique per page' 'Conflicting paths returned from getStaticPaths, paths must unique per page'
) )
expect(output).toContain('err.sh/next.js/conflicting-ssg-paths') expect(output).toContain(
'https://nextjs.org/docs/messages/conflicting-ssg-paths'
)
expect(output).toContain( expect(output).toContain(
`path: "/blog/conflicting" from page: "/[...catchAll]"` `path: "/blog/conflicting" from page: "/[...catchAll]"`
) )
...@@ -123,7 +125,9 @@ describe('Conflicting SSG paths', () => { ...@@ -123,7 +125,9 @@ describe('Conflicting SSG paths', () => {
expect(output).toContain( expect(output).toContain(
'Conflicting paths returned from getStaticPaths, paths must unique per page' 'Conflicting paths returned from getStaticPaths, paths must unique per page'
) )
expect(output).toContain('err.sh/next.js/conflicting-ssg-paths') expect(output).toContain(
'https://nextjs.org/docs/messages/conflicting-ssg-paths'
)
expect(output).toContain( expect(output).toContain(
`path: "/hellO/world" from page: "/[...catchAll]" conflicts with path: "/hello/world"` `path: "/hellO/world" from page: "/[...catchAll]" conflicts with path: "/hello/world"`
) )
...@@ -175,7 +179,9 @@ describe('Conflicting SSG paths', () => { ...@@ -175,7 +179,9 @@ describe('Conflicting SSG paths', () => {
expect(output).toContain( expect(output).toContain(
'Conflicting paths returned from getStaticPaths, paths must unique per page' 'Conflicting paths returned from getStaticPaths, paths must unique per page'
) )
expect(output).toContain('err.sh/next.js/conflicting-ssg-paths') expect(output).toContain(
'https://nextjs.org/docs/messages/conflicting-ssg-paths'
)
expect(output).toContain( expect(output).toContain(
`path: "/hellO/world" from page: "/[...catchAll]" conflicts with path: "/hello/world"` `path: "/hellO/world" from page: "/[...catchAll]" conflicts with path: "/hello/world"`
) )
......
...@@ -21,7 +21,7 @@ export default function (context) { ...@@ -21,7 +21,7 @@ export default function (context) {
) )
expect(stderr).toContain( expect(stderr).toContain(
'https://err.sh/vercel/next.js/api-routes-static-export' 'https://nextjs.org/docs/messages/api-routes-static-export'
) )
}) })
}) })
......
...@@ -20,7 +20,7 @@ export default function (context) { ...@@ -20,7 +20,7 @@ export default function (context) {
).catch((err) => err) ).catch((err) => err)
expect(stderr).toContain( expect(stderr).toContain(
'https://err.sh/vercel/next.js/export-path-mismatch' 'https://nextjs.org/docs/messages/export-path-mismatch'
) )
}) })
}) })
......
...@@ -21,7 +21,7 @@ export default function (context) { ...@@ -21,7 +21,7 @@ export default function (context) {
) )
expect(stderr).toContain( expect(stderr).toContain(
'https://err.sh/vercel/next.js/api-routes-static-export' 'https://nextjs.org/docs/messages/api-routes-static-export'
) )
}) })
}) })
......
...@@ -20,7 +20,7 @@ export default function (context) { ...@@ -20,7 +20,7 @@ export default function (context) {
).catch((err) => err) ).catch((err) => err)
expect(stderr).toContain( expect(stderr).toContain(
'https://err.sh/vercel/next.js/export-path-mismatch' 'https://nextjs.org/docs/messages/export-path-mismatch'
) )
}) })
}) })
......
...@@ -262,7 +262,7 @@ const runTests = () => { ...@@ -262,7 +262,7 @@ const runTests = () => {
) )
expect(stderr).toContain( expect(stderr).toContain(
`Error parsing \`/feedback/(?!general)\` https://err.sh/vercel/next.js/invalid-route-source` `Error parsing \`/feedback/(?!general)\` https://nextjs.org/docs/messages/invalid-route-source`
) )
expect(stderr).toContain( expect(stderr).toContain(
...@@ -285,7 +285,7 @@ const runTests = () => { ...@@ -285,7 +285,7 @@ const runTests = () => {
) )
expect(stderr).toContain( expect(stderr).toContain(
`The route /hello rewrites urls outside of the basePath. Please use a destination that starts with \`http://\` or \`https://\` https://err.sh/vercel/next.js/invalid-external-rewrite` `The route /hello rewrites urls outside of the basePath. Please use a destination that starts with \`http://\` or \`https://\` https://nextjs.org/docs/messages/invalid-external-rewrite`
) )
expect(stderr).toContain('Invalid `has` item:') expect(stderr).toContain('Invalid `has` item:')
...@@ -486,13 +486,13 @@ const runTests = () => { ...@@ -486,13 +486,13 @@ const runTests = () => {
const stderr = await getStderr() const stderr = await getStderr()
expect(stderr).toContain( expect(stderr).toContain(
`Error parsing \`/feedback/(?!general)\` https://err.sh/vercel/next.js/invalid-route-source` `Error parsing \`/feedback/(?!general)\` https://nextjs.org/docs/messages/invalid-route-source`
) )
expect(stderr).toContain(`Reason: Pattern cannot start with "?" at 11`) expect(stderr).toContain(`Reason: Pattern cannot start with "?" at 11`)
expect(stderr).toContain(`/feedback/(?!general)`) expect(stderr).toContain(`/feedback/(?!general)`)
expect(stderr).toContain( expect(stderr).toContain(
`Error parsing \`/learning/?\` https://err.sh/vercel/next.js/invalid-route-source` `Error parsing \`/learning/?\` https://nextjs.org/docs/messages/invalid-route-source`
) )
expect(stderr).toContain(`Reason: Unexpected MODIFIER at 10, expected END`) expect(stderr).toContain(`Reason: Unexpected MODIFIER at 10, expected END`)
expect(stderr).toContain(`/learning/?`) expect(stderr).toContain(`/learning/?`)
......
...@@ -121,7 +121,7 @@ describe('Invalid hrefs', () => { ...@@ -121,7 +121,7 @@ describe('Invalid hrefs', () => {
expect( expect(
errors.find((err) => errors.find((err) =>
err.includes( err.includes(
'The provided `as` value (/blog/post-1) is incompatible with the `href` value (/[post]). Read more: https://err.sh/vercel/next.js/incompatible-href-as' 'The provided `as` value (/blog/post-1) is incompatible with the `href` value (/[post]). Read more: https://nextjs.org/docs/messages/incompatible-href-as'
) )
) )
).toBeTruthy() ).toBeTruthy()
......
...@@ -24,7 +24,7 @@ const runTests = () => { ...@@ -24,7 +24,7 @@ const runTests = () => {
'To use a multi-match in the destination you must add' 'To use a multi-match in the destination you must add'
) )
expect(stderr).toContain( expect(stderr).toContain(
'https://err.sh/vercel/next.js/invalid-multi-match' 'https://nextjs.org/docs/messages/invalid-multi-match'
) )
}) })
} }
......
...@@ -2,24 +2,24 @@ import next from 'next' ...@@ -2,24 +2,24 @@ import next from 'next'
import { join } from 'path' import { join } from 'path'
const dir = join(__dirname, '../') const dir = join(__dirname, '../')
const warningMessage = const warningMessage =
"Warning: 'dev' is not a boolean which could introduce unexpected behavior. https://err.sh/next.js/invalid-server-options" "Warning: 'dev' is not a boolean which could introduce unexpected behavior. https://nextjs.org/docs/messages/invalid-server-options"
describe('Invalid server options', () => { describe('Invalid server options', () => {
test('next() called with no parameters should throw error', () => { test('next() called with no parameters should throw error', () => {
expect(() => next()).toThrowError( expect(() => next()).toThrowError(
'The server has not been instantiated properly. https://err.sh/next.js/invalid-server-options' 'The server has not been instantiated properly. https://nextjs.org/docs/messages/invalid-server-options'
) )
}) })
test('next() called with undefined parameter should throw error', () => { test('next() called with undefined parameter should throw error', () => {
expect(() => next(undefined)).toThrowError( expect(() => next(undefined)).toThrowError(
'The server has not been instantiated properly. https://err.sh/next.js/invalid-server-options' 'The server has not been instantiated properly. https://nextjs.org/docs/messages/invalid-server-options'
) )
}) })
test('next() called with null parameter should throw error', () => { test('next() called with null parameter should throw error', () => {
expect(() => next(null)).toThrowError( expect(() => next(null)).toThrowError(
'The server has not been instantiated properly. https://err.sh/next.js/invalid-server-options' 'The server has not been instantiated properly. https://nextjs.org/docs/messages/invalid-server-options'
) )
}) })
......
...@@ -17,8 +17,6 @@ describe('Dynamic require', () => { ...@@ -17,8 +17,6 @@ describe('Dynamic require', () => {
it('should show error when a Next prop is returned in _app.getInitialProps', async () => { it('should show error when a Next prop is returned in _app.getInitialProps', async () => {
const html = await renderViaHTTP(appPort, '/') const html = await renderViaHTTP(appPort, '/')
expect(html).toMatch( expect(html).toMatch(/\/cant-override-next-props/)
/https:\/\/err\.sh\/vercel\/next\.js\/cant-override-next-props/
)
}) })
}) })
...@@ -29,9 +29,7 @@ describe('Page Config', () => { ...@@ -29,9 +29,7 @@ describe('Page Config', () => {
try { try {
const { stderr } = await nextBuild(appDir, undefined, { stderr: true }) const { stderr } = await nextBuild(appDir, undefined, { stderr: true })
expect(stderr).toMatch( expect(stderr).toMatch(/\/invalid-page-config/)
/https:\/\/err\.sh\/vercel\/next\.js\/invalid-page-config/
)
} finally { } finally {
await reset() await reset()
} }
...@@ -42,9 +40,7 @@ describe('Page Config', () => { ...@@ -42,9 +40,7 @@ describe('Page Config', () => {
try { try {
const { stderr } = await nextBuild(appDir, undefined, { stderr: true }) const { stderr } = await nextBuild(appDir, undefined, { stderr: true })
expect(stderr).toMatch( expect(stderr).toMatch(/\/invalid-page-config/)
/https:\/\/err\.sh\/vercel\/next\.js\/invalid-page-config/
)
} finally { } finally {
await reset() await reset()
} }
...@@ -55,9 +51,7 @@ describe('Page Config', () => { ...@@ -55,9 +51,7 @@ describe('Page Config', () => {
try { try {
const { stderr } = await nextBuild(appDir, undefined, { stderr: true }) const { stderr } = await nextBuild(appDir, undefined, { stderr: true })
expect(stderr).toMatch( expect(stderr).toMatch(/\/invalid-page-config/)
/https:\/\/err\.sh\/vercel\/next\.js\/invalid-page-config/
)
} finally { } finally {
await reset() await reset()
} }
...@@ -68,9 +62,7 @@ describe('Page Config', () => { ...@@ -68,9 +62,7 @@ describe('Page Config', () => {
try { try {
const { stderr } = await nextBuild(appDir, undefined, { stderr: true }) const { stderr } = await nextBuild(appDir, undefined, { stderr: true })
expect(stderr).toMatch( expect(stderr).toMatch(/\/invalid-page-config/)
/https:\/\/err\.sh\/vercel\/next\.js\/invalid-page-config/
)
} finally { } finally {
await reset() await reset()
} }
...@@ -81,9 +73,7 @@ describe('Page Config', () => { ...@@ -81,9 +73,7 @@ describe('Page Config', () => {
try { try {
const { stderr } = await nextBuild(appDir, undefined, { stderr: true }) const { stderr } = await nextBuild(appDir, undefined, { stderr: true })
expect(stderr).toMatch( expect(stderr).toMatch(/\/invalid-page-config/)
/https:\/\/err\.sh\/vercel\/next\.js\/invalid-page-config/
)
} finally { } finally {
await reset() await reset()
} }
...@@ -94,9 +84,7 @@ describe('Page Config', () => { ...@@ -94,9 +84,7 @@ describe('Page Config', () => {
try { try {
const { stderr } = await nextBuild(appDir, undefined, { stderr: true }) const { stderr } = await nextBuild(appDir, undefined, { stderr: true })
expect(stderr).toMatch( expect(stderr).toMatch(/\/invalid-page-config/)
/https:\/\/err\.sh\/vercel\/next\.js\/invalid-page-config/
)
} finally { } finally {
await reset() await reset()
} }
...@@ -107,9 +95,7 @@ describe('Page Config', () => { ...@@ -107,9 +95,7 @@ describe('Page Config', () => {
try { try {
const { stderr } = await nextBuild(appDir, undefined, { stderr: true }) const { stderr } = await nextBuild(appDir, undefined, { stderr: true })
expect(stderr).toMatch( expect(stderr).toMatch(/\/invalid-page-config/)
/https:\/\/err\.sh\/vercel\/next\.js\/invalid-page-config/
)
} finally { } finally {
await reset() await reset()
} }
......
...@@ -12,12 +12,12 @@ describe('Re-export all exports from page is disallowed', () => { ...@@ -12,12 +12,12 @@ describe('Re-export all exports from page is disallowed', () => {
stderr: true, stderr: true,
}) })
expect(code).toBe(1) expect(code).toBe(1)
expect(stderr).toMatch(/https:\/\/err\.sh\/next\.js\/export-all-in-page/) expect(stderr).toMatch(/\/export-all-in-page/)
expect(stderr.split('\n\n')[1]).toMatchInlineSnapshot(` expect(stderr.split('\n\n')[1]).toMatchInlineSnapshot(`
"./pages/contact.js:3:1 "./pages/contact.js:3:1
Syntax error: Using \`export * from '...'\` in a page is disallowed. Please use \`export { default } from '...'\` instead. Syntax error: Using \`export * from '...'\` in a page is disallowed. Please use \`export { default } from '...'\` instead.
Read more: https://err.sh/next.js/export-all-in-page" Read more: https://nextjs.org/docs/messages/export-all-in-page"
`) `)
}) })
...@@ -29,9 +29,7 @@ describe('Re-export all exports from page is disallowed', () => { ...@@ -29,9 +29,7 @@ describe('Re-export all exports from page is disallowed', () => {
stderr: true, stderr: true,
}) })
expect(code).toBe(0) expect(code).toBe(0)
expect(stderr).not.toMatch( expect(stderr).not.toMatch(/\/export-all-in-page/)
/https:\/\/err\.sh\/next\.js\/export-all-in-page/
)
} finally { } finally {
f.restore() f.restore()
} }
......
...@@ -45,7 +45,7 @@ describe('SCSS Support', () => { ...@@ -45,7 +45,7 @@ describe('SCSS Support', () => {
'Run `npm i sass` or `yarn add sass` inside your workspace.' 'Run `npm i sass` or `yarn add sass` inside your workspace.'
) )
expect(stderr).toContain( expect(stderr).toContain(
'Learn more: https://err.sh/next.js/install-sass' 'Learn more: https://nextjs.org/docs/messages/install-sass'
) )
}) })
}) })
......
...@@ -109,7 +109,7 @@ describe('withRouter SSR', () => { ...@@ -109,7 +109,7 @@ describe('withRouter SSR', () => {
const browser = await webdriver(port, '/router-method-ssr') const browser = await webdriver(port, '/router-method-ssr')
expect(await hasRedbox(browser)).toBe(true) expect(await hasRedbox(browser)).toBe(true)
expect(await getRedboxHeader(browser)).toMatch( expect(await getRedboxHeader(browser)).toMatch(
`No router instance found. you should only use "next/router" inside the client side of your app. https://err.sh/` `No router instance found. you should only use "next/router" inside the client side of your app. https://`
) )
await browser.close() await browser.close()
}) })
......
...@@ -11,7 +11,7 @@ const nextBin = path.join(nextDir, 'dist/bin/next') ...@@ -11,7 +11,7 @@ const nextBin = path.join(nextDir, 'dist/bin/next')
describe('Handles Incorrect React Version', () => { describe('Handles Incorrect React Version', () => {
it('should throw an error when building with next', async () => { it('should throw an error when building with next', async () => {
expect(() => require(nextBin)).toThrow( expect(() => require(nextBin)).toThrow(
/The version of React you are using is lower than the minimum required version needed for Next\.js\. Please upgrade "react" and "react-dom": "npm install react react-dom" https:\/\/err\.sh/ /The version of React you are using is lower than the minimum required version needed for Next\.js\. Please upgrade "react" and "react-dom": "npm install react react-dom" https:\/\//
) )
}) })
}) })
...@@ -8,7 +8,7 @@ describe('loadGetInitialProps', () => { ...@@ -8,7 +8,7 @@ describe('loadGetInitialProps', () => {
} }
const rejectPromise = loadGetInitialProps(TestComponent, {}) const rejectPromise = loadGetInitialProps(TestComponent, {})
const error = new Error( const error = new Error(
'"TestComponent.getInitialProps()" is defined as an instance method - visit https://err.sh/vercel/next.js/get-initial-props-as-an-instance-method for more information.' '"TestComponent.getInitialProps()" is defined as an instance method - visit https://nextjs.org/docs/messages/get-initial-props-as-an-instance-method for more information.'
) )
return expect(rejectPromise).rejects.toEqual(error) return expect(rejectPromise).rejects.toEqual(error)
}) })
......
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