]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
feat(dx): link errors to docs in prod build (#9165)
author三咲智子 Kevin Deng <sxzz@sxzz.moe>
Mon, 27 Nov 2023 23:38:36 +0000 (07:38 +0800)
committerEvan You <yyx990803@gmail.com>
Mon, 27 Nov 2023 23:39:11 +0000 (07:39 +0800)
packages/compiler-core/src/errors.ts
packages/runtime-core/src/errorHandling.ts

index 36ab783edbe00d2175fd78252df4f50b4912bc1b..dac779dab542eb90362bd51c072f5870cd18dcd6 100644 (file)
@@ -30,7 +30,7 @@ export function createCompilerError<T extends number>(
   const msg =
     __DEV__ || !__BROWSER__
       ? (messages || errorMessages)[code] + (additionalMessage || ``)
-      : code
+      : `https://vuejs.org/errors/#compiler-${code}`
   const error = new SyntaxError(String(msg)) as InferCompilerError<T>
   error.code = code
   error.loc = loc
index afbd226c4c6aa53b71a507574be579ec4bfa44c5..f3c03cc9e4f80b9c32106ecdd6106c4f8af38f89 100644 (file)
@@ -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) {