re-throw svelte error immediately

pull/16248/head
7nik 3 months ago
parent 4dfad73786
commit bda8955687

@ -136,6 +136,10 @@ export function hydrate(component, options) {
return /** @type {Exports} */ (instance); return /** @type {Exports} */ (instance);
} catch (error) { } catch (error) {
// re-throw Svelte errors - they are certainly not related to hydration
if (error instanceof Error && error.message.includes('https://svelte.dev/e/')) {
throw error;
}
if (error !== HYDRATION_ERROR) { if (error !== HYDRATION_ERROR) {
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.error('Failed to hydrate: ', error); console.error('Failed to hydrate: ', error);

@ -1,7 +1,6 @@
import { test } from '../../test'; import { test } from '../../test';
export default test({ export default test({
mode: ['server', 'client'],
compileOptions: { compileOptions: {
dev: true dev: true
}, },

@ -2,7 +2,6 @@ import { flushSync } from 'svelte';
import { test } from '../../test'; import { test } from '../../test';
export default test({ export default test({
mode: ['client'],
compileOptions: { compileOptions: {
dev: true dev: true
}, },

@ -5,7 +5,6 @@ import { test } from '../../test';
// uses a prop it does not write to but has a fallback value // uses a prop it does not write to but has a fallback value
export default test({ export default test({
accessors: false, // so that prop actually becomes $.prop and not $.prop_source accessors: false, // so that prop actually becomes $.prop and not $.prop_source
mode: ['server', 'client'],
html: `<button>0</button><span>0</span>`, html: `<button>0</button><span>0</span>`,
test({ assert, target }) { test({ assert, target }) {

Loading…
Cancel
Save