Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 743d52a

Browse files
authored
fix: don't crash on undefined document.contentType (#17707)
closes #17706
1 parent 220b526 commit 743d52a

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

.changeset/curvy-pants-hide.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
fix: don't crash on undefined `document.contentType`

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export const STALE_REACTION = new (class StaleReactionError extends Error {
6767
message = 'The reaction that called `getAbortSignal()` was re-run or destroyed';
6868
})();
6969

70-
export const IS_XHTML = /* @__PURE__ */ globalThis.document?.contentType.includes('xml') ?? false;
70+
export const IS_XHTML = /* @__PURE__ */ globalThis.document?.contentType?.includes('xml') ?? false;
7171
export const ELEMENT_NODE = 1;
7272
export const TEXT_NODE = 3;
7373
export const COMMENT_NODE = 8;

0 commit comments

Comments
 (0)