Skip to content

Commit

Permalink
Update err.sh links to use nextjs.org/docs/messages instead (vercel#2…
Browse files Browse the repository at this point in the history
  • Loading branch information
timneutkens authored Mar 29, 2021
1 parent d49f978 commit b34a0c9
Show file tree
Hide file tree
Showing 57 changed files with 165 additions and 179 deletions.
2 changes: 1 addition & 1 deletion docs/advanced-features/codemods.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
2 changes: 1 addition & 1 deletion docs/basic-features/static-file-serving.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion packages/next/bin/next.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`
)
}

Expand Down
2 changes: 1 addition & 1 deletion packages/next/build/babel/plugins/next-page-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
2 changes: 1 addition & 1 deletion packages/next/build/generate-build-id.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
)
}

Expand Down
18 changes: 9 additions & 9 deletions packages/next/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`
)
}
}
Expand Down Expand Up @@ -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'
)}`
)
Expand All @@ -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`
)
}

Expand Down Expand Up @@ -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'
)
}

Expand Down Expand Up @@ -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`
)
}

Expand Down Expand Up @@ -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.`
)
}

Expand All @@ -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')
Expand Down Expand Up @@ -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'
)
}

Expand Down Expand Up @@ -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`
)
}

Expand Down
2 changes: 1 addition & 1 deletion packages/next/build/output/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/next/build/plugins/collect-plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ async function collectPluginMeta(
)
}

// TODO: add err.sh explaining requirements
// TODO: add error link explaining requirements
let middleware: string[] = []
try {
middleware = (
Expand Down
6 changes: 3 additions & 3 deletions packages/next/build/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 ||
Expand Down Expand Up @@ -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`
)
}

Expand Down Expand Up @@ -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)
Expand Down
12 changes: 6 additions & 6 deletions packages/next/build/webpack-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
)
}
)
Expand Down Expand Up @@ -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`
)
}

Expand Down Expand Up @@ -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]
}
Expand Down Expand Up @@ -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'
)
}

Expand All @@ -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'
)
}
}
Expand Down Expand Up @@ -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'
)
}

Expand Down
6 changes: 3 additions & 3 deletions packages/next/build/webpack/config/blocks/css/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ 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() {
return `Global CSS ${chalk.bold(
'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() {
return `CSS Modules ${chalk.bold(
'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() {
Expand Down
12 changes: 6 additions & 6 deletions packages/next/build/webpack/config/blocks/css/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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'
)
}

Expand Down Expand Up @@ -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)
Expand All @@ -202,15 +202,15 @@ 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 {
console.error(
`${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)
}
Expand Down
4 changes: 2 additions & 2 deletions packages/next/cli/next-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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'
)
}
}
Expand Down
6 changes: 3 additions & 3 deletions packages/next/cli/next-dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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'
)
}
}
Expand All @@ -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'
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
2 changes: 1 addition & 1 deletion packages/next/client/head-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion packages/next/client/image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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`
)
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/next/client/link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
)
}
}
Expand Down
Loading

0 comments on commit b34a0c9

Please sign in to comment.