diff --git a/components/Code.tsx b/components/Code.tsx index 00eb931..cb55e12 100644 --- a/components/Code.tsx +++ b/components/Code.tsx @@ -1,6 +1,9 @@ import React from 'react'; import darcula from 'react-syntax-highlighter/dist/cjs/styles/prism/darcula'; -import { PrismAsyncLight as SyntaxHighlighter } from 'react-syntax-highlighter'; +import { PrismLight, PrismAsyncLight } from "react-syntax-highlighter" + +const SyntaxHighlighter = + typeof window === "undefined" ? PrismLight : PrismAsyncLight export default class Code extends React.PureComponent<{ language: string;