mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-15 06:19:24 +02:00
chore: Disable mermaid in SSR
This commit is contained in:
@@ -127,7 +127,7 @@ Error.prepareStackTrace
|
||||
|
||||
#### 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
|
||||
|
||||
node_modules/@types/node/globals.d.ts:30
|
||||
node_modules/@types/node/globals.d.ts:100
|
||||
|
||||
## Methods
|
||||
|
||||
@@ -168,4 +168,4 @@ Error.captureStackTrace
|
||||
|
||||
#### 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;
|
||||
};
|
||||
|
||||
setTimeout(main, 100)
|
||||
if (!import.meta.env.SSR) {
|
||||
setTimeout(main, 100);
|
||||
}
|
||||
</script>
|
||||
|
@@ -17,7 +17,14 @@ declare global {
|
||||
mermaid: typeof mermaid;
|
||||
render: typeof render;
|
||||
}
|
||||
}
|
||||
|
||||
window.mermaid = mermaid;
|
||||
window.render = render;
|
||||
interface ImportMeta {
|
||||
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;
|
||||
};
|
||||
|
||||
setTimeout(main, 100)
|
||||
if (!import.meta.env.SSR) {
|
||||
setTimeout(main, 100);
|
||||
}
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user