Skip to content

Commit 0300fbc

Browse files
committed
log error as warn
1 parent bda8955 commit 0300fbc

File tree

2 files changed

+5
-18
lines changed
  • packages/svelte

2 files changed

+5
-18
lines changed

packages/svelte/src/internal/client/render.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export function hydrate(component, options) {
142142
}
143143
if (error !== HYDRATION_ERROR) {
144144
// eslint-disable-next-line no-console
145-
console.error('Failed to hydrate: ', error);
145+
console.warn('Failed to hydrate: ', error);
146146
}
147147

148148
if (options.recover === false) {
Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,8 @@
11
import { test } from '../../test';
22

3-
/** @type {string[]} */
4-
let logs = [];
5-
/** @type {typeof console['error']} */
6-
let console_error;
7-
83
export default test({
9-
before_test() {
10-
console_error = console.error;
11-
console.error = (...args) => logs.push(args.join(''));
12-
},
13-
after_test() {
14-
console.error = console_error;
15-
},
16-
test({ deepEqual }) {
17-
deepEqual(logs, [
18-
"Failed to hydrate: HierarchyRequestError: Node can't be inserted in a #text parent."
19-
]);
20-
}
4+
errors: [
5+
'Failed to hydrate: ',
6+
new DOMException("Node can't be inserted in a #text parent.", 'HierarchyRequestError')
7+
]
218
});

0 commit comments

Comments
 (0)