diff --git a/docs/advanced-features/codemods.md b/docs/advanced-features/codemods.md index d20824316e58d..e6e990cfe9cf1 100644 --- a/docs/advanced-features/codemods.md +++ b/docs/advanced-features/codemods.md @@ -132,7 +132,7 @@ npx @next/codemod withamp-to-config ### `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: diff --git a/docs/basic-features/static-file-serving.md b/docs/basic-features/static-file-serving.md index 713070969e185..c4234b7aa2f2e 100644 --- a/docs/basic-features/static-file-serving.md +++ b/docs/basic-features/static-file-serving.md @@ -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. > -> Read more: +> Read more: > **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. diff --git a/packages/next/bin/next.ts b/packages/next/bin/next.ts index 9b85368ff04b6..a81a185983e6c 100755 --- a/packages/next/bin/next.ts +++ b/packages/next/bin/next.ts @@ -98,7 +98,7 @@ const React = require('react') if (typeof React.Suspense === 'undefined') { 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` ) } diff --git a/packages/next/build/babel/plugins/next-page-config.ts b/packages/next/build/babel/plugins/next-page-config.ts index bafb76b411341..b6a122e6e4572 100644 --- a/packages/next/build/babel/plugins/next-page-config.ts +++ b/packages/next/build/babel/plugins/next-page-config.ts @@ -30,7 +30,7 @@ function replaceBundle(path: any, t: typeof BabelTypes): void { function errorMessage(state: any, details: string): string { const pageName = (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 { diff --git a/packages/next/build/babel/plugins/next-page-disallow-re-export-all-exports.ts b/packages/next/build/babel/plugins/next-page-disallow-re-export-all-exports.ts index 0329e64c6298f..93ffe83ea838b 100644 --- a/packages/next/build/babel/plugins/next-page-disallow-re-export-all-exports.ts +++ b/packages/next/build/babel/plugins/next-page-disallow-re-export-all-exports.ts @@ -6,7 +6,7 @@ export default function NextPageDisallowReExportAllExports(): PluginObj { ExportAllDeclaration(path: NodePath) { const err = new SyntaxError( `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).loc = diff --git a/packages/next/build/generate-build-id.ts b/packages/next/build/generate-build-id.ts index 0f9de31c1ddb4..aed1d6c864e9a 100644 --- a/packages/next/build/generate-build-id.ts +++ b/packages/next/build/generate-build-id.ts @@ -14,7 +14,7 @@ export async function generateBuildId( if (typeof buildId !== 'string') { 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' ) } diff --git a/packages/next/build/index.ts b/packages/next/build/index.ts index 7f39349836900..575d74f69e9d1 100644 --- a/packages/next/build/index.ts +++ b/packages/next/build/index.ts @@ -151,7 +151,7 @@ export default async function build( // Intentionally not piping to stderr in case people fail in CI when // stderr is detected. 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( throw new Error( `Conflicting public and page file${ 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' )}` ) @@ -319,7 +319,7 @@ export default async function build( Log.warn( `The following reserved Next.js pages were detected not directly under the pages directory:\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( if (!distDirCreated || !(await isWriteable(distDir))) { 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( clientConfig.optimization.minimizer.length === 0)) ) { 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( const parsed = page_name_regex.exec(error) const page_name = parsed && parsed.groups && parsed.groups.page_name 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( error.indexOf('__next_polyfill__') > -1 ) { 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') @@ -719,7 +719,7 @@ export default async function build( ) ) 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( .map((pg) => `pages${pg}`) .join( '\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` ) } diff --git a/packages/next/build/output/store.ts b/packages/next/build/output/store.ts index 12dbf11647e8f..3c371b30ee5ae 100644 --- a/packages/next/build/output/store.ts +++ b/packages/next/build/output/store.ts @@ -64,7 +64,7 @@ store.subscribe((state) => { for (const match of matches) { const prop = (match.split(']').shift() || '').substr(1) 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 diff --git a/packages/next/build/plugins/collect-plugins.ts b/packages/next/build/plugins/collect-plugins.ts index bb5c5e33c96a7..e0e0d9bccd4c4 100644 --- a/packages/next/build/plugins/collect-plugins.ts +++ b/packages/next/build/plugins/collect-plugins.ts @@ -63,7 +63,7 @@ async function collectPluginMeta( ) } - // TODO: add err.sh explaining requirements + // TODO: add error link explaining requirements let middleware: string[] = [] try { middleware = ( diff --git a/packages/next/build/utils.ts b/packages/next/build/utils.ts index 2d425ed5003be..c29735acdfb0b 100644 --- a/packages/next/build/utils.ts +++ b/packages/next/build/utils.ts @@ -541,7 +541,7 @@ export async function buildStaticPaths( const expectedReturnVal = `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 ( !staticPathsResult || @@ -807,7 +807,7 @@ export async function isPageStatic( if (hasStaticProps && pageIsDynamic && !hasStaticPaths) { throw new Error( `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( Log.error( '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 ) process.exit(1) diff --git a/packages/next/build/webpack-config.ts b/packages/next/build/webpack-config.ts index 4ab87e84dd808..18b06d2a9903e 100644 --- a/packages/next/build/webpack-config.ts +++ b/packages/next/build/webpack-config.ts @@ -70,7 +70,7 @@ const devtoolRevertWarning = execOnce( chalk.yellow.bold('Warning: ') + chalk.bold(`Reverting webpack devtool to '${devtool}'.\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( ...Object.keys(config.env).reduce((acc, key) => { if (/^(?:NODE_.+)|^(?:__.+)$/i.test(key)) { 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( new Proxy(${isServer ? 'process.env' : '{}'}, { get(target, prop) { 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] } @@ -1363,7 +1363,7 @@ export default async function getBaseWebpackConfig( if (!webpackConfig) { 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' + - '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( if (typeof (webpackConfig as any).then === 'function') { 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( chalk.bold( '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' ) } diff --git a/packages/next/build/webpack/config/blocks/css/messages.ts b/packages/next/build/webpack/config/blocks/css/messages.ts index 30831d54eb362..c06dc19eec3e7 100644 --- a/packages/next/build/webpack/config/blocks/css/messages.ts +++ b/packages/next/build/webpack/config/blocks/css/messages.ts @@ -7,7 +7,7 @@ export function getGlobalImportError(file: string | null) { 'Custom ' )}. Please move all global CSS imports to ${chalk.cyan( 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() { @@ -15,7 +15,7 @@ export function getGlobalModuleImportError() { 'cannot' )} be imported from within ${chalk.bold( 'node_modules' - )}.\nRead more: https://err.sh/next.js/css-npm` + )}.\nRead more: https://nextjs.org/docs/messages/css-npm` } export function getLocalModuleImportError() { @@ -23,7 +23,7 @@ export function getLocalModuleImportError() { 'cannot' )} be imported from within ${chalk.bold( '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() { diff --git a/packages/next/build/webpack/config/blocks/css/plugins.ts b/packages/next/build/webpack/config/blocks/css/plugins.ts index 7aa6d22e41d95..5b07f3ae470b3 100644 --- a/packages/next/build/webpack/config/blocks/css/plugins.ts +++ b/packages/next/build/webpack/config/blocks/css/plugins.ts @@ -37,7 +37,7 @@ function isIgnoredPlugin(pluginPath: string): boolean { plugin )} plugin from your PostCSS configuration. ` + `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 } @@ -119,7 +119,7 @@ export async function getPostCssPlugins( if (typeof config === 'function') { throw new Error( `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( )}: A PostCSS Plugin must be provided as a ${chalk.bold( 'string' )}. Instead, we got: '${pluginName}'.\n` + - 'Read more: https://err.sh/next.js/postcss-shape' + 'Read more: https://nextjs.org/docs/messages/postcss-shape' ) } else { console.error( `${chalk.red.bold( 'Error' )}: 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) @@ -202,7 +202,7 @@ export async function getPostCssPlugins( 'Error' )}: A PostCSS Plugin was passed as a function using require(), but it must be provided as a ${chalk.bold( 'string' - )}.\nRead more: https://err.sh/next.js/postcss-shape` + )}.\nRead more: https://nextjs.org/docs/messages/postcss-shape` ) throw new Error(genericErrorText) } else { @@ -210,7 +210,7 @@ export async function getPostCssPlugins( `${chalk.red.bold( 'Error' )}: 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) } diff --git a/packages/next/cli/next-build.ts b/packages/next/cli/next-build.ts index a3e08062512a8..ad3b78232abcb 100755 --- a/packages/next/cli/next-build.ts +++ b/packages/next/cli/next-build.ts @@ -72,7 +72,7 @@ const nextBuild: cliCommand = (argv) => { ) { Log.warn( '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 { const reactDomVersion: string | null = await getPackageVersion({ @@ -86,7 +86,7 @@ const nextBuild: cliCommand = (argv) => { ) { Log.warn( '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' ) } } diff --git a/packages/next/cli/next-dev.ts b/packages/next/cli/next-dev.ts index a4c09d2c69b77..0850160bede6d 100755 --- a/packages/next/cli/next-dev.ts +++ b/packages/next/cli/next-dev.ts @@ -73,7 +73,7 @@ const nextDev: cliCommand = (argv) => { ) { Log.warn( '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 { const reactDomVersion: string | null = await getPackageVersion({ @@ -87,7 +87,7 @@ const nextDev: cliCommand = (argv) => { ) { Log.warn( '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) => { Log.warn( '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. ' + - ' Read more: https://err.sh/next.js/duplicate-sass' + ' Read more: https://nextjs.org/docs/messages/duplicate-sass' ) } } diff --git a/packages/next/client/dev/error-overlay/format-webpack-messages.js b/packages/next/client/dev/error-overlay/format-webpack-messages.js index 8ad928e47fb35..2d7a4d292d4d0 100644 --- a/packages/next/client/dev/error-overlay/format-webpack-messages.js +++ b/packages/next/client/dev/error-overlay/format-webpack-messages.js @@ -105,7 +105,7 @@ function formatMessage(message) { lines[1] = "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] += '\nLearn more: https://err.sh/next.js/install-sass' + lines[1] += '\nLearn more: https://nextjs.org/docs/messages/install-sass' } message = lines.join('\n') diff --git a/packages/next/client/head-manager.ts b/packages/next/client/head-manager.ts index 9e2da8f6007d1..99d7cee807a53 100644 --- a/packages/next/client/head-manager.ts +++ b/packages/next/client/head-manager.ts @@ -48,7 +48,7 @@ function updateElements(type: string, components: JSX.Element[]): void { if (process.env.NODE_ENV !== 'production') { if (!headCountEl) { 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 } diff --git a/packages/next/client/image.tsx b/packages/next/client/image.tsx index 2beb54f840559..8f8957740e655 100644 --- a/packages/next/client/image.tsx +++ b/packages/next/client/image.tsx @@ -577,7 +577,7 @@ function defaultLoader({ if (!configDomains.includes(parsedSrc.hostname)) { throw new Error( `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` ) } } diff --git a/packages/next/client/link.tsx b/packages/next/client/link.tsx index d3d018a79d79a..dd676480ec969 100644 --- a/packages/next/client/link.tsx +++ b/packages/next/client/link.tsx @@ -206,7 +206,7 @@ function Link(props: React.PropsWithChildren) { if (props.prefetch && !hasWarned.current) { hasWarned.current = true 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' ) } } diff --git a/packages/next/export/index.ts b/packages/next/export/index.ts index 439c088d3a679..5513a1b83aa21 100644 --- a/packages/next/export/index.ts +++ b/packages/next/export/index.ts @@ -181,7 +181,7 @@ export default async function exportApp( if (!existsSync(buildIdFile)) { 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( Log.warn( `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( if (outDir === join(dir, 'public')) { 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')) { 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( - Use any provider which supports Image Optimization (like Vercel). - Configure a third-party loader in \`next.config.js\`. - 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( ) + `\n` + 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( } if (hadValidationError) { 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` ) } diff --git a/packages/next/export/worker.ts b/packages/next/export/worker.ts index e560dcfc37bb2..27da634b5cacf 100644 --- a/packages/next/export/worker.ts +++ b/packages/next/export/worker.ts @@ -159,7 +159,7 @@ export default async function exportPage({ } } else { 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({ return results } catch (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 ) return { ...results, error: true } diff --git a/packages/next/lib/constants.ts b/packages/next/lib/constants.ts index 878779267890f..28636f4594104 100644 --- a/packages/next/lib/constants.ts +++ b/packages/next/lib/constants.ts @@ -22,7 +22,7 @@ export const API_ROUTE = /^\/api(?:\/|$)/ export const PAGES_DIR_ALIAS = 'private-next-pages' 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` @@ -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 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 = '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 = 'The `unstable_revalidate` property is available for general use.\n' + '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` diff --git a/packages/next/lib/load-custom-routes.ts b/packages/next/lib/load-custom-routes.ts index fcaf42dee741e..d518fe16e1523 100644 --- a/packages/next/lib/load-custom-routes.ts +++ b/packages/next/lib/load-custom-routes.ts @@ -133,21 +133,21 @@ function tryParsePath(route: string, handleUrl?: boolean): ParseAttemptResult { result.tokens = pathToRegexp.parse(routePath) pathToRegexp.tokensToRegexp(result.tokens) } 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,})/) if (errMatches) { const position = parseInt(errMatches[1], 10) console.error( `\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` + ` ${routePath}\n` + ` ${new Array(position).fill(' ').join('')}^\n` ) } else { 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 ) } @@ -172,7 +172,7 @@ function checkCustomRoutes( if (!Array.isArray(routes)) { throw new Error( `${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( console.error( `The route ${ (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++ continue diff --git a/packages/next/next-server/lib/dynamic.tsx b/packages/next/next-server/lib/dynamic.tsx index 904c338864e5a..53931abde0782 100644 --- a/packages/next/next-server/lib/dynamic.tsx +++ b/packages/next/next-server/lib/dynamic.tsx @@ -125,7 +125,7 @@ export default function dynamic

( if (process.env.NODE_ENV !== 'production') { if (dynamicOptions.modules) { 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' ) } } diff --git a/packages/next/next-server/lib/router/router.ts b/packages/next/next-server/lib/router/router.ts index e3ef78e9f993b..77793276a5f6a 100644 --- a/packages/next/next-server/lib/router/router.ts +++ b/packages/next/next-server/lib/router/router.ts @@ -993,7 +993,7 @@ export default class Router implements BaseRouter { if (process.env.NODE_ENV !== 'production') { throw new Error( `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 { ', ' )}) to be interpolated properly. ` : `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 ? 'href-interpolation-failed' : 'incompatible-href-as' diff --git a/packages/next/next-server/lib/router/utils/prepare-destination.ts b/packages/next/next-server/lib/router/utils/prepare-destination.ts index c5395b228ad44..9421764487f14 100644 --- a/packages/next/next-server/lib/router/utils/prepare-destination.ts +++ b/packages/next/next-server/lib/router/utils/prepare-destination.ts @@ -236,7 +236,7 @@ export default function prepareDestination( } catch (err) { if (err.message.match(/Expected .*? to not repeat, but got an array/)) { 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 diff --git a/packages/next/next-server/lib/router/utils/sorted-routes.ts b/packages/next/next-server/lib/router/utils/sorted-routes.ts index 987b65cc957cd..d3f0699bd1cf5 100644 --- a/packages/next/next-server/lib/router/utils/sorted-routes.ts +++ b/packages/next/next-server/lib/router/utils/sorted-routes.ts @@ -120,7 +120,7 @@ class UrlNode { // pages/[id]/index.js // Because currently multiple dynamic params on the same segment level are not supported 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( `You cannot use different slug names for the same dynamic path ('${previousSlug}' !== '${nextSlug}').` ) diff --git a/packages/next/next-server/lib/utils.ts b/packages/next/next-server/lib/utils.ts index e09c3c0618df1..228dd892bb20a 100644 --- a/packages/next/next-server/lib/utils.ts +++ b/packages/next/next-server/lib/utils.ts @@ -318,7 +318,7 @@ export async function loadGetInitialProps< if (App.prototype?.getInitialProps) { const message = `"${getDisplayName( 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) } } @@ -353,7 +353,7 @@ export async function loadGetInitialProps< console.warn( `${getDisplayName( 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` ) } } diff --git a/packages/next/next-server/server/config-shared.ts b/packages/next/next-server/server/config-shared.ts index 1da25c195bc73..4460b010d1638 100644 --- a/packages/next/next-server/server/config-shared.ts +++ b/packages/next/next-server/server/config-shared.ts @@ -134,7 +134,7 @@ export function normalizeConfig(phase: string, config: any) { if (typeof config.then === 'function') { 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' ) } } diff --git a/packages/next/next-server/server/config.ts b/packages/next/next-server/server/config.ts index 42f4eba85f5b9..b8fa8597ad803 100644 --- a/packages/next/next-server/server/config.ts +++ b/packages/next/next-server/server/config.ts @@ -60,7 +60,7 @@ function assignDefaults(userConfig: { [key: string]: any }) { // public files if (userDistDir === 'public') { throw new Error( - `The 'public' directory is reserved in Next.js and can not be set as the 'distDir'. https://err.sh/vercel/next.js/can-not-output-to-public` + `The 'public' directory is reserved in Next.js and can not be set as the 'distDir'. https://nextjs.org/docs/messages/can-not-output-to-public` ) } // make sure distDir isn't an empty string as it can result in the provided @@ -118,7 +118,7 @@ function assignDefaults(userConfig: { [key: string]: any }) { if (typeof result.assetPrefix !== 'string') { throw new Error( - `Specified assetPrefix is not a string, found type "${typeof result.assetPrefix}" https://err.sh/vercel/next.js/invalid-assetprefix` + `Specified assetPrefix is not a string, found type "${typeof result.assetPrefix}" https://nextjs.org/docs/messages/invalid-assetprefix` ) } @@ -163,20 +163,20 @@ function assignDefaults(userConfig: { [key: string]: any }) { if (typeof images !== 'object') { throw new Error( - `Specified images should be an object received ${typeof images}.\nSee more info here: https://err.sh/next.js/invalid-images-config` + `Specified images should be an object received ${typeof images}.\nSee more info here: https://nextjs.org/docs/messages/invalid-images-config` ) } if (images.domains) { if (!Array.isArray(images.domains)) { throw new Error( - `Specified images.domains should be an Array received ${typeof images.domains}.\nSee more info here: https://err.sh/next.js/invalid-images-config` + `Specified images.domains should be an Array received ${typeof images.domains}.\nSee more info here: https://nextjs.org/docs/messages/invalid-images-config` ) } if (images.domains.length > 50) { throw new Error( - `Specified images.domains exceeds length of 50, received length (${images.domains.length}), please reduce the length of the array to continue.\nSee more info here: https://err.sh/next.js/invalid-images-config` + `Specified images.domains exceeds length of 50, received length (${images.domains.length}), please reduce the length of the array to continue.\nSee more info here: https://nextjs.org/docs/messages/invalid-images-config` ) } @@ -187,7 +187,7 @@ function assignDefaults(userConfig: { [key: string]: any }) { throw new Error( `Specified images.domains should be an Array of strings received invalid values (${invalid.join( ', ' - )}).\nSee more info here: https://err.sh/next.js/invalid-images-config` + )}).\nSee more info here: https://nextjs.org/docs/messages/invalid-images-config` ) } } @@ -195,13 +195,13 @@ function assignDefaults(userConfig: { [key: string]: any }) { const { deviceSizes } = images if (!Array.isArray(deviceSizes)) { throw new Error( - `Specified images.deviceSizes should be an Array received ${typeof deviceSizes}.\nSee more info here: https://err.sh/next.js/invalid-images-config` + `Specified images.deviceSizes should be an Array received ${typeof deviceSizes}.\nSee more info here: https://nextjs.org/docs/messages/invalid-images-config` ) } if (deviceSizes.length > 25) { throw new Error( - `Specified images.deviceSizes exceeds length of 25, received length (${deviceSizes.length}), please reduce the length of the array to continue.\nSee more info here: https://err.sh/next.js/invalid-images-config` + `Specified images.deviceSizes exceeds length of 25, received length (${deviceSizes.length}), please reduce the length of the array to continue.\nSee more info here: https://nextjs.org/docs/messages/invalid-images-config` ) } @@ -213,7 +213,7 @@ function assignDefaults(userConfig: { [key: string]: any }) { throw new Error( `Specified images.deviceSizes should be an Array of numbers that are between 1 and 10000, received invalid values (${invalid.join( ', ' - )}).\nSee more info here: https://err.sh/next.js/invalid-images-config` + )}).\nSee more info here: https://nextjs.org/docs/messages/invalid-images-config` ) } } @@ -221,13 +221,13 @@ function assignDefaults(userConfig: { [key: string]: any }) { const { imageSizes } = images if (!Array.isArray(imageSizes)) { throw new Error( - `Specified images.imageSizes should be an Array received ${typeof imageSizes}.\nSee more info here: https://err.sh/next.js/invalid-images-config` + `Specified images.imageSizes should be an Array received ${typeof imageSizes}.\nSee more info here: https://nextjs.org/docs/messages/invalid-images-config` ) } if (imageSizes.length > 25) { throw new Error( - `Specified images.imageSizes exceeds length of 25, received length (${imageSizes.length}), please reduce the length of the array to continue.\nSee more info here: https://err.sh/next.js/invalid-images-config` + `Specified images.imageSizes exceeds length of 25, received length (${imageSizes.length}), please reduce the length of the array to continue.\nSee more info here: https://nextjs.org/docs/messages/invalid-images-config` ) } @@ -239,7 +239,7 @@ function assignDefaults(userConfig: { [key: string]: any }) { throw new Error( `Specified images.imageSizes should be an Array of numbers that are between 1 and 10000, received invalid values (${invalid.join( ', ' - )}).\nSee more info here: https://err.sh/next.js/invalid-images-config` + )}).\nSee more info here: https://nextjs.org/docs/messages/invalid-images-config` ) } } @@ -254,7 +254,7 @@ function assignDefaults(userConfig: { [key: string]: any }) { ', ' )}), received invalid value (${ images.loader - }).\nSee more info here: https://err.sh/next.js/invalid-images-config` + }).\nSee more info here: https://nextjs.org/docs/messages/invalid-images-config` ) } @@ -279,13 +279,13 @@ function assignDefaults(userConfig: { [key: string]: any }) { if (i18nType !== 'object') { throw new Error( - `Specified i18n should be an object received ${i18nType}.\nSee more info here: https://err.sh/next.js/invalid-i18n-config` + `Specified i18n should be an object received ${i18nType}.\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config` ) } if (!Array.isArray(i18n.locales)) { throw new Error( - `Specified i18n.locales should be an Array received ${typeof i18n.locales}.\nSee more info here: https://err.sh/next.js/invalid-i18n-config` + `Specified i18n.locales should be an Array received ${typeof i18n.locales}.\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config` ) } @@ -293,13 +293,13 @@ function assignDefaults(userConfig: { [key: string]: any }) { if (!i18n.defaultLocale || defaultLocaleType !== 'string') { throw new Error( - `Specified i18n.defaultLocale should be a string.\nSee more info here: https://err.sh/next.js/invalid-i18n-config` + `Specified i18n.defaultLocale should be a string.\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config` ) } if (typeof i18n.domains !== 'undefined' && !Array.isArray(i18n.domains)) { throw new Error( - `Specified i18n.domains must be an array of domain objects e.g. [ { domain: 'example.fr', defaultLocale: 'fr', locales: ['fr'] } ] received ${typeof i18n.domains}.\nSee more info here: https://err.sh/next.js/invalid-i18n-config` + `Specified i18n.domains must be an array of domain objects e.g. [ { domain: 'example.fr', defaultLocale: 'fr', locales: ['fr'] } ] received ${typeof i18n.domains}.\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config` ) } @@ -337,14 +337,14 @@ function assignDefaults(userConfig: { [key: string]: any }) { .map((item: any) => JSON.stringify(item)) .join( '\n' - )}\n\ndomains value must follow format { domain: 'example.fr', defaultLocale: 'fr', locales: ['fr'] }.\nSee more info here: https://err.sh/next.js/invalid-i18n-config` + )}\n\ndomains value must follow format { domain: 'example.fr', defaultLocale: 'fr', locales: ['fr'] }.\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config` ) } } if (!Array.isArray(i18n.locales)) { throw new Error( - `Specified i18n.locales must be an array of locale strings e.g. ["en-US", "nl-NL"] received ${typeof i18n.locales}.\nSee more info here: https://err.sh/next.js/invalid-i18n-config` + `Specified i18n.locales must be an array of locale strings e.g. ["en-US", "nl-NL"] received ${typeof i18n.locales}.\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config` ) } @@ -365,7 +365,7 @@ function assignDefaults(userConfig: { [key: string]: any }) { if (!i18n.locales.includes(i18n.defaultLocale)) { throw new Error( - `Specified i18n.defaultLocale should be included in i18n.locales.\nSee more info here: https://err.sh/next.js/invalid-i18n-config` + `Specified i18n.defaultLocale should be included in i18n.locales.\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config` ) } @@ -382,7 +382,7 @@ function assignDefaults(userConfig: { [key: string]: any }) { localeDetectionType !== 'undefined' ) { throw new Error( - `Specified i18n.localeDetection should be undefined or a boolean received ${localeDetectionType}.\nSee more info here: https://err.sh/next.js/invalid-i18n-config` + `Specified i18n.localeDetection should be undefined or a boolean received ${localeDetectionType}.\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config` ) } } @@ -414,7 +414,7 @@ export default async function loadConfig( if (Object.keys(userConfig).length === 0) { Log.warn( - '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://nextjs.org/docs/messages/empty-configuration' ) } diff --git a/packages/next/next-server/server/next-server.ts b/packages/next/next-server/server/next-server.ts index c3f8e9f9a444f..9f4bfa43030f8 100644 --- a/packages/next/next-server/server/next-server.ts +++ b/packages/next/next-server/server/next-server.ts @@ -1253,7 +1253,7 @@ export default class Server { ): Promise { if (!pathname.startsWith('/')) { 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 { console.warn( chalk.bold.yellow(`Warning: `) + 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 { } catch (err) { if (!fs.existsSync(buildIdFile)) { 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` ) } diff --git a/packages/next/next-server/server/render.tsx b/packages/next/next-server/server/render.tsx index 8830769d9c418..9052e38e59fcc 100644 --- a/packages/next/next-server/server/render.tsx +++ b/packages/next/next-server/server/render.tsx @@ -64,7 +64,7 @@ import { DomainLocales } from './config' function noRouter() { 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) } @@ -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.:` + `\n\n\treturn { props: { title: 'My Title', content: '...' } }` + `\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( `Invalid redirect object returned from ${method} for ${req.url}\n` + errors.join(' and ') + '\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( if (isSSG && pageIsDynamic && !getStaticPaths) { throw new Error( `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( throw new Error( `\`redirect\` and \`notFound\` can not both be returned from ${ 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( if (isBuildTimeSSG) { throw new Error( `\`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( ) { console.warn( `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( if (dev && (props.router || props.Component)) { 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( warn( `Your custom Document (pages/_document) did not render all the required subcomponent${plural}.\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' ) } } diff --git a/packages/next/pages/_app.tsx b/packages/next/pages/_app.tsx index 265c06c15a44d..0a2e8e80d8ab4 100644 --- a/packages/next/pages/_app.tsx +++ b/packages/next/pages/_app.tsx @@ -66,13 +66,13 @@ let warnUrl: () => void if (process.env.NODE_ENV !== 'production') { warnContainer = execOnce(() => { 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(() => { 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` ) }) } diff --git a/packages/next/pages/_document.tsx b/packages/next/pages/_document.tsx index 882fe217c0908..dea39bef67cc2 100644 --- a/packages/next/pages/_document.tsx +++ b/packages/next/pages/_document.tsx @@ -406,14 +406,14 @@ export class Head extends Component< if (!isReactHelmet) { if (child?.type === 'title') { console.warn( - "Warning: 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 ( child?.type === 'meta' && child?.props?.name === 'viewport' ) { 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< }) if (this.props.crossOrigin) 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< if (badProp) { 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 } @@ -763,7 +763,7 @@ export class NextScript extends Component<OriginProps> { } catch (err) { if (err.message.indexOf('circular structure')) { 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 @@ -828,7 +828,7 @@ export class NextScript extends Component<OriginProps> { if (process.env.NODE_ENV !== 'production') { if (this.props.crossOrigin) 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' ) } diff --git a/packages/next/server/next-dev-server.ts b/packages/next/server/next-dev-server.ts index 2c86900367da0..0d095c62e8213 100644 --- a/packages/next/server/next-dev-server.ts +++ b/packages/next/server/next-dev-server.ts @@ -43,7 +43,7 @@ import { NextConfig } from '../next-server/server/config' if (typeof React.Suspense === 'undefined') { 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 { } if (fs.existsSync(pathJoin(this.dir, 'static'))) { 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 @@ -362,7 +362,7 @@ export default class DevServer extends Server { if (await this.hasPublicFile(decodedPath)) { if (await this.hasPage(pathname!)) { 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 await this.renderError(err, req, res, pathname!, {}) @@ -662,7 +662,7 @@ export default class DevServer extends Server { if (!err && res.statusCode === 500) { err = new Error( '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' ) } diff --git a/packages/next/server/next.ts b/packages/next/server/next.ts index 53723db999475..d834c7ad48555 100644 --- a/packages/next/server/next.ts +++ b/packages/next/server/next.ts @@ -148,7 +148,7 @@ function createServer(options: NextServerConstructor): NextServer { if (options == null) { 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 { if (options.dev) { if (typeof options.dev !== 'boolean') { 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" ) } } diff --git a/test/integration/api-support/test/index.test.js b/test/integration/api-support/test/index.test.js index de878765f842a..1b7972ff9c875 100644 --- a/test/integration/api-support/test/index.test.js +++ b/test/integration/api-support/test/index.test.js @@ -456,7 +456,7 @@ function runTests(dev = false) { { stderr: true } ) expect(stderr).toContain( - 'https://err.sh/vercel/next.js/api-routes-static-export' + 'https://nextjs.org/docs/messages/api-routes-static-export' ) }) diff --git a/test/integration/client-navigation/test/rendering.js b/test/integration/client-navigation/test/rendering.js index 397eb9680405c..f858a133bce29 100644 --- a/test/integration/client-navigation/test/rendering.js +++ b/test/integration/client-navigation/test/rendering.js @@ -257,7 +257,7 @@ export default function (render, fetch, ctx) { ) 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) const text = await getRedboxHeader(browser) diff --git a/test/integration/config-empty/test/index.test.js b/test/integration/config-empty/test/index.test.js index bfdd55dcb23a6..90d8e8c0de060 100644 --- a/test/integration/config-empty/test/index.test.js +++ b/test/integration/config-empty/test/index.test.js @@ -21,7 +21,7 @@ describe('Empty configuration', () => { }) expect(stdout).toMatch(/Compiled successfully/) 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', () => { await killApp(app) 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:\/\// ) }) }) diff --git a/test/integration/config-promise-error/test/index.test.js b/test/integration/config-promise-error/test/index.test.js index 8431bab2a510a..43eb06f715256 100644 --- a/test/integration/config-promise-error/test/index.test.js +++ b/test/integration/config-promise-error/test/index.test.js @@ -24,7 +24,7 @@ describe('Promise in next config', () => { ) 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', () => { { stderr: true } ) - expect(stderr).toMatch( - /> Promise returned in next config\. https:\/\/err\.sh\/vercel\/next\.js\/promise-in-next-config/ - ) + expect(stderr).toMatch(/> Promise returned in next config\. https:\/\//) }) }) diff --git a/test/integration/config-resolve-alias/test/index.test.js b/test/integration/config-resolve-alias/test/index.test.js index 82f4103aff76b..4fde61cb71673 100644 --- a/test/integration/config-resolve-alias/test/index.test.js +++ b/test/integration/config-resolve-alias/test/index.test.js @@ -12,7 +12,7 @@ describe('Invalid resolve alias', () => { }) expect(stderr).toMatch( - 'webpack config.resolve.alias was incorrectly overridden. https://err.sh' + 'webpack config.resolve.alias was incorrectly overridden. https://' ) }) }) diff --git a/test/integration/conflicting-ssg-paths/test/index.test.js b/test/integration/conflicting-ssg-paths/test/index.test.js index 5be2b86932038..cc3df55b66193 100644 --- a/test/integration/conflicting-ssg-paths/test/index.test.js +++ b/test/integration/conflicting-ssg-paths/test/index.test.js @@ -72,7 +72,9 @@ describe('Conflicting SSG paths', () => { expect(output).toContain( '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( `path: "/blog/conflicting" from page: "/[...catchAll]"` ) @@ -123,7 +125,9 @@ describe('Conflicting SSG paths', () => { expect(output).toContain( '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( `path: "/hellO/world" from page: "/[...catchAll]" conflicts with path: "/hello/world"` ) @@ -175,7 +179,9 @@ describe('Conflicting SSG paths', () => { expect(output).toContain( '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( `path: "/hellO/world" from page: "/[...catchAll]" conflicts with path: "/hello/world"` ) diff --git a/test/integration/export-serverless/test/api-routes.js b/test/integration/export-serverless/test/api-routes.js index a5f629f7d33ac..7d0bcdf80eaa2 100644 --- a/test/integration/export-serverless/test/api-routes.js +++ b/test/integration/export-serverless/test/api-routes.js @@ -21,7 +21,7 @@ export default function (context) { ) expect(stderr).toContain( - 'https://err.sh/vercel/next.js/api-routes-static-export' + 'https://nextjs.org/docs/messages/api-routes-static-export' ) }) }) diff --git a/test/integration/export-serverless/test/dynamic.js b/test/integration/export-serverless/test/dynamic.js index 5b95b223db7f8..e3e4117d75b00 100644 --- a/test/integration/export-serverless/test/dynamic.js +++ b/test/integration/export-serverless/test/dynamic.js @@ -20,7 +20,7 @@ export default function (context) { ).catch((err) => err) expect(stderr).toContain( - 'https://err.sh/vercel/next.js/export-path-mismatch' + 'https://nextjs.org/docs/messages/export-path-mismatch' ) }) }) diff --git a/test/integration/export/test/api-routes.js b/test/integration/export/test/api-routes.js index a5f629f7d33ac..7d0bcdf80eaa2 100644 --- a/test/integration/export/test/api-routes.js +++ b/test/integration/export/test/api-routes.js @@ -21,7 +21,7 @@ export default function (context) { ) expect(stderr).toContain( - 'https://err.sh/vercel/next.js/api-routes-static-export' + 'https://nextjs.org/docs/messages/api-routes-static-export' ) }) }) diff --git a/test/integration/export/test/dynamic.js b/test/integration/export/test/dynamic.js index 5b95b223db7f8..e3e4117d75b00 100644 --- a/test/integration/export/test/dynamic.js +++ b/test/integration/export/test/dynamic.js @@ -20,7 +20,7 @@ export default function (context) { ).catch((err) => err) expect(stderr).toContain( - 'https://err.sh/vercel/next.js/export-path-mismatch' + 'https://nextjs.org/docs/messages/export-path-mismatch' ) }) }) diff --git a/test/integration/invalid-custom-routes/test/index.test.js b/test/integration/invalid-custom-routes/test/index.test.js index 268e601cb36f5..d088bbf3848ec 100644 --- a/test/integration/invalid-custom-routes/test/index.test.js +++ b/test/integration/invalid-custom-routes/test/index.test.js @@ -262,7 +262,7 @@ const runTests = () => { ) 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( @@ -285,7 +285,7 @@ const runTests = () => { ) 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:') @@ -486,13 +486,13 @@ const runTests = () => { const stderr = await getStderr() 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(`/feedback/(?!general)`) 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(`/learning/?`) diff --git a/test/integration/invalid-href/test/index.test.js b/test/integration/invalid-href/test/index.test.js index e202446da8ea1..5900593515ee0 100644 --- a/test/integration/invalid-href/test/index.test.js +++ b/test/integration/invalid-href/test/index.test.js @@ -121,7 +121,7 @@ describe('Invalid hrefs', () => { expect( errors.find((err) => 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() diff --git a/test/integration/invalid-multi-match/test/index.test.js b/test/integration/invalid-multi-match/test/index.test.js index 2bb70eb925863..4c4018c909391 100644 --- a/test/integration/invalid-multi-match/test/index.test.js +++ b/test/integration/invalid-multi-match/test/index.test.js @@ -24,7 +24,7 @@ const runTests = () => { 'To use a multi-match in the destination you must add' ) expect(stderr).toContain( - 'https://err.sh/vercel/next.js/invalid-multi-match' + 'https://nextjs.org/docs/messages/invalid-multi-match' ) }) } diff --git a/test/integration/invalid-server-options/test/index.test.js b/test/integration/invalid-server-options/test/index.test.js index 9137fffdb31db..3259a5d0ece52 100644 --- a/test/integration/invalid-server-options/test/index.test.js +++ b/test/integration/invalid-server-options/test/index.test.js @@ -2,24 +2,24 @@ import next from 'next' import { join } from 'path' const dir = join(__dirname, '../') 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', () => { test('next() called with no parameters should throw error', () => { 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', () => { 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', () => { 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' ) }) diff --git a/test/integration/no-override-next-props/test/index.test.js b/test/integration/no-override-next-props/test/index.test.js index 5eccd6bb7f026..0dbcd1ae4e64b 100644 --- a/test/integration/no-override-next-props/test/index.test.js +++ b/test/integration/no-override-next-props/test/index.test.js @@ -17,8 +17,6 @@ describe('Dynamic require', () => { it('should show error when a Next prop is returned in _app.getInitialProps', async () => { const html = await renderViaHTTP(appPort, '/') - expect(html).toMatch( - /https:\/\/err\.sh\/vercel\/next\.js\/cant-override-next-props/ - ) + expect(html).toMatch(/\/cant-override-next-props/) }) }) diff --git a/test/integration/page-config/test/index.test.js b/test/integration/page-config/test/index.test.js index a1d8b649be145..db09448dac520 100644 --- a/test/integration/page-config/test/index.test.js +++ b/test/integration/page-config/test/index.test.js @@ -29,9 +29,7 @@ describe('Page Config', () => { try { const { stderr } = await nextBuild(appDir, undefined, { stderr: true }) - expect(stderr).toMatch( - /https:\/\/err\.sh\/vercel\/next\.js\/invalid-page-config/ - ) + expect(stderr).toMatch(/\/invalid-page-config/) } finally { await reset() } @@ -42,9 +40,7 @@ describe('Page Config', () => { try { const { stderr } = await nextBuild(appDir, undefined, { stderr: true }) - expect(stderr).toMatch( - /https:\/\/err\.sh\/vercel\/next\.js\/invalid-page-config/ - ) + expect(stderr).toMatch(/\/invalid-page-config/) } finally { await reset() } @@ -55,9 +51,7 @@ describe('Page Config', () => { try { const { stderr } = await nextBuild(appDir, undefined, { stderr: true }) - expect(stderr).toMatch( - /https:\/\/err\.sh\/vercel\/next\.js\/invalid-page-config/ - ) + expect(stderr).toMatch(/\/invalid-page-config/) } finally { await reset() } @@ -68,9 +62,7 @@ describe('Page Config', () => { try { const { stderr } = await nextBuild(appDir, undefined, { stderr: true }) - expect(stderr).toMatch( - /https:\/\/err\.sh\/vercel\/next\.js\/invalid-page-config/ - ) + expect(stderr).toMatch(/\/invalid-page-config/) } finally { await reset() } @@ -81,9 +73,7 @@ describe('Page Config', () => { try { const { stderr } = await nextBuild(appDir, undefined, { stderr: true }) - expect(stderr).toMatch( - /https:\/\/err\.sh\/vercel\/next\.js\/invalid-page-config/ - ) + expect(stderr).toMatch(/\/invalid-page-config/) } finally { await reset() } @@ -94,9 +84,7 @@ describe('Page Config', () => { try { const { stderr } = await nextBuild(appDir, undefined, { stderr: true }) - expect(stderr).toMatch( - /https:\/\/err\.sh\/vercel\/next\.js\/invalid-page-config/ - ) + expect(stderr).toMatch(/\/invalid-page-config/) } finally { await reset() } @@ -107,9 +95,7 @@ describe('Page Config', () => { try { const { stderr } = await nextBuild(appDir, undefined, { stderr: true }) - expect(stderr).toMatch( - /https:\/\/err\.sh\/vercel\/next\.js\/invalid-page-config/ - ) + expect(stderr).toMatch(/\/invalid-page-config/) } finally { await reset() } diff --git a/test/integration/re-export-all-exports-from-page-disallowed/test/index.test.js b/test/integration/re-export-all-exports-from-page-disallowed/test/index.test.js index 1bc50c1d50caa..96bbb34def382 100644 --- a/test/integration/re-export-all-exports-from-page-disallowed/test/index.test.js +++ b/test/integration/re-export-all-exports-from-page-disallowed/test/index.test.js @@ -12,12 +12,12 @@ describe('Re-export all exports from page is disallowed', () => { stderr: true, }) 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(` "./pages/contact.js:3:1 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', () => { stderr: true, }) expect(code).toBe(0) - expect(stderr).not.toMatch( - /https:\/\/err\.sh\/next\.js\/export-all-in-page/ - ) + expect(stderr).not.toMatch(/\/export-all-in-page/) } finally { f.restore() } diff --git a/test/integration/scss/test/index.test.js b/test/integration/scss/test/index.test.js index 1bfb00abae253..f3e578a578645 100644 --- a/test/integration/scss/test/index.test.js +++ b/test/integration/scss/test/index.test.js @@ -45,7 +45,7 @@ describe('SCSS Support', () => { 'Run `npm i sass` or `yarn add sass` inside your workspace.' ) expect(stderr).toContain( - 'Learn more: https://err.sh/next.js/install-sass' + 'Learn more: https://nextjs.org/docs/messages/install-sass' ) }) }) diff --git a/test/integration/with-router/test/index.test.js b/test/integration/with-router/test/index.test.js index ebd4375a42c32..5035de4bded56 100644 --- a/test/integration/with-router/test/index.test.js +++ b/test/integration/with-router/test/index.test.js @@ -109,7 +109,7 @@ describe('withRouter SSR', () => { const browser = await webdriver(port, '/router-method-ssr') expect(await hasRedbox(browser)).toBe(true) 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() }) diff --git a/test/unit/handles-incorrect-react.unit.test.js b/test/unit/handles-incorrect-react.unit.test.js index 32f5d53647b5f..777eb59181440 100644 --- a/test/unit/handles-incorrect-react.unit.test.js +++ b/test/unit/handles-incorrect-react.unit.test.js @@ -11,7 +11,7 @@ const nextBin = path.join(nextDir, 'dist/bin/next') describe('Handles Incorrect React Version', () => { it('should throw an error when building with next', async () => { 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:\/\// ) }) }) diff --git a/test/unit/loadGetInitialProps.unit.test.js b/test/unit/loadGetInitialProps.unit.test.js index 44f7d74b2d8d6..bb9e59797d131 100644 --- a/test/unit/loadGetInitialProps.unit.test.js +++ b/test/unit/loadGetInitialProps.unit.test.js @@ -8,7 +8,7 @@ describe('loadGetInitialProps', () => { } const rejectPromise = loadGetInitialProps(TestComponent, {}) 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) })