|
|
|
@ -136,7 +136,18 @@ export function hydrate(component, options) {
|
|
|
|
|
|
|
|
|
|
return /** @type {Exports} */ (instance);
|
|
|
|
|
} catch (error) {
|
|
|
|
|
if (error === HYDRATION_ERROR) {
|
|
|
|
|
// re-throw Svelte errors - they are certainly not related to hydration
|
|
|
|
|
if (
|
|
|
|
|
error instanceof Error &&
|
|
|
|
|
error.message.split('\n').some((line) => line.startsWith('https://svelte.dev/e/'))
|
|
|
|
|
) {
|
|
|
|
|
throw error;
|
|
|
|
|
}
|
|
|
|
|
if (error !== HYDRATION_ERROR) {
|
|
|
|
|
// eslint-disable-next-line no-console
|
|
|
|
|
console.warn('Failed to hydrate: ', error);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (options.recover === false) {
|
|
|
|
|
e.hydration_failed();
|
|
|
|
|
}
|
|
|
|
@ -147,9 +158,6 @@ export function hydrate(component, options) {
|
|
|
|
|
|
|
|
|
|
set_hydrating(false);
|
|
|
|
|
return mount(component, options);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
throw error;
|
|
|
|
|
} finally {
|
|
|
|
|
set_hydrating(was_hydrating);
|
|
|
|
|
set_hydrate_node(previous_hydrate_node);
|
|
|
|
|