mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-27 12:16:40 +02:00
chore: Disable mermaid in SSR
This commit is contained in:
@@ -127,7 +127,7 @@ Error.prepareStackTrace
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
node_modules/@types/node/globals.d.ts:28
|
node_modules/@types/node/globals.d.ts:98
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -141,7 +141,7 @@ Error.stackTraceLimit
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
node_modules/@types/node/globals.d.ts:30
|
node_modules/@types/node/globals.d.ts:100
|
||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
@@ -168,4 +168,4 @@ Error.captureStackTrace
|
|||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
node_modules/@types/node/globals.d.ts:21
|
node_modules/@types/node/globals.d.ts:91
|
||||||
|
@@ -267,5 +267,7 @@ const main = async () => {
|
|||||||
document.getElementById('arch-example').innerHTML = svg;
|
document.getElementById('arch-example').innerHTML = svg;
|
||||||
};
|
};
|
||||||
|
|
||||||
setTimeout(main, 100)
|
if (!import.meta.env.SSR) {
|
||||||
|
setTimeout(main, 100);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@@ -17,7 +17,14 @@ declare global {
|
|||||||
mermaid: typeof mermaid;
|
mermaid: typeof mermaid;
|
||||||
render: typeof render;
|
render: typeof render;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
window.mermaid = mermaid;
|
interface ImportMeta {
|
||||||
window.render = render;
|
env: {
|
||||||
|
SSR: boolean;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!import.meta.env.SSR) {
|
||||||
|
window.mermaid = mermaid;
|
||||||
|
window.render = render;
|
||||||
|
}
|
||||||
|
@@ -229,5 +229,7 @@ const main = async () => {
|
|||||||
document.getElementById('arch-example').innerHTML = svg;
|
document.getElementById('arch-example').innerHTML = svg;
|
||||||
};
|
};
|
||||||
|
|
||||||
setTimeout(main, 100)
|
if (!import.meta.env.SSR) {
|
||||||
|
setTimeout(main, 100);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
Reference in New Issue
Block a user