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
### `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:
......
......@@ -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: <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.
......@@ -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`
)
}
......
......@@ -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 {
......
......@@ -6,7 +6,7 @@ export default function NextPageDisallowReExportAllExports(): PluginObj<any> {
ExportAllDeclaration(path: NodePath<types.ExportAllDeclaration>) {
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 =
......
......@@ -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'
)
}
......
......@@ -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`
)
}
......
......@@ -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
......
......@@ -63,7 +63,7 @@ async function collectPluginMeta(
)
}
// TODO: add err.sh explaining requirements
// TODO: add error link explaining requirements
let middleware: string[] = []
try {
middleware = (
......
......@@ -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)
......
......@@ -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'
)
}
......
......@@ -7,7 +7,7 @@ export function getGlobalImportError(file: string | null) {
'Custom <App>'
)}. 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() {
......
......@@ -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)
}
......
......@@ -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'
)
}
}
......
......@@ -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'
)
}
}
......
......@@ -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')
......
......@@ -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
}
......
......@@ -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`
)
}
}
......
......@@ -206,7 +206,7 @@ function Link(props: React.PropsWithChildren<LinkProps>) {
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'
)
}
}
......
......@@ -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`
)
}
......
......@@ -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 }
......
......@@ -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`
......@@ -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
......
......@@ -125,7 +125,7 @@ export default function dynamic<P = {}>(
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'
)
}
}
......
......@@ -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'
......
......@@ -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
......
......@@ -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}').`
)
......
......@@ -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`
)
}
}
......
......@@ -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'
)
}
}
......
This diff is collapsed.
......@@ -1253,7 +1253,7 @@ export default class Server {
): Promise<void> {
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`
)
}
......
......@@ -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'
)
}
}
......
......@@ -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`
)
})
}
......
......@@ -406,14 +406,14 @@ export class Head extends Component<
if (!isReactHelmet) {
if (child?.type === 'title') {
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 (
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'
)
}
......
......@@ -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'
)
}
......
......@@ -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"
)
}
}
......
......@@ -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'
)
})
......
......@@ -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)
......
......@@ -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:\/\//
)
})
})
......@@ -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:\/\//)
})
})
......@@ -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://'
)
})
})
......@@ -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"`
)
......
......@@ -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'
)
})
})
......
......@@ -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'
)
})
})
......
......@@ -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'
)
})
})
......
......@@ -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'
)
})
})
......
......@@ -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/?`)
......
......@@ -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()
......
......@@ -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'
)
})
}
......
......@@ -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'
)
})
......
......@@ -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/)
})
})
......@@ -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()
}
......
......@@ -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()
}
......
......@@ -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'
)
})
})
......
......@@ -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()
})
......
......@@ -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:\/\//
)
})
})
......@@ -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)
})
......
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