From: 三咲智子 Kevin Deng Date: Mon, 27 Nov 2023 23:38:36 +0000 (+0800) Subject: feat(dx): link errors to docs in prod build (#9165) X-Git-Tag: v3.4.0-alpha.3~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9f8ba9821fe166f77e63fa940e9e7e13ec3344fa;p=thirdparty%2Fvuejs%2Fcore.git feat(dx): link errors to docs in prod build (#9165) --- diff --git a/packages/compiler-core/src/errors.ts b/packages/compiler-core/src/errors.ts index 36ab783edb..dac779dab5 100644 --- a/packages/compiler-core/src/errors.ts +++ b/packages/compiler-core/src/errors.ts @@ -30,7 +30,7 @@ export function createCompilerError( const msg = __DEV__ || !__BROWSER__ ? (messages || errorMessages)[code] + (additionalMessage || ``) - : code + : `https://vuejs.org/errors/#compiler-${code}` const error = new SyntaxError(String(msg)) as InferCompilerError error.code = code error.loc = loc diff --git a/packages/runtime-core/src/errorHandling.ts b/packages/runtime-core/src/errorHandling.ts index afbd226c4c..f3c03cc9e4 100644 --- a/packages/runtime-core/src/errorHandling.ts +++ b/packages/runtime-core/src/errorHandling.ts @@ -110,7 +110,9 @@ export function handleError( // the exposed instance is the render proxy to keep it consistent with 2.x const exposedInstance = instance.proxy // in production the hook receives only the error code - const errorInfo = __DEV__ ? ErrorTypeStrings[type] : type + const errorInfo = __DEV__ + ? ErrorTypeStrings[type] + : `https://vuejs.org/errors/#runtime-${type}` while (cur) { const errorCapturedHooks = cur.ec if (errorCapturedHooks) {