Skip to content

Commit 9f8ba98

Browse files
sxzzyyx990803
authored andcommittedNov 27, 2023
feat(dx): link errors to docs in prod build (#9165)
1 parent e49dffc commit 9f8ba98

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed
 

‎packages/compiler-core/src/errors.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export function createCompilerError<T extends number>(
3030
const msg =
3131
__DEV__ || !__BROWSER__
3232
? (messages || errorMessages)[code] + (additionalMessage || ``)
33-
: code
33+
: `https://vuejs.org/errors/#compiler-${code}`
3434
const error = new SyntaxError(String(msg)) as InferCompilerError<T>
3535
error.code = code
3636
error.loc = loc

‎packages/runtime-core/src/errorHandling.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@ export function handleError(
110110
// the exposed instance is the render proxy to keep it consistent with 2.x
111111
const exposedInstance = instance.proxy
112112
// in production the hook receives only the error code
113-
const errorInfo = __DEV__ ? ErrorTypeStrings[type] : type
113+
const errorInfo = __DEV__
114+
? ErrorTypeStrings[type]
115+
: `https://vuejs.org/errors/#runtime-${type}`
114116
while (cur) {
115117
const errorCapturedHooks = cur.ec
116118
if (errorCapturedHooks) {

0 commit comments

Comments
 (0)
Please sign in to comment.