Skip to content

Commit

Permalink
fix: dynamic import client module to avoid ssr error
Browse files Browse the repository at this point in the history
  • Loading branch information
yongenaelf committed Aug 21, 2024
1 parent 320c758 commit 33496fa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions components/webcontainer/node-terminal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,5 @@ export function NodeTerminal() {

return <div ref={terminalElRef}></div>;
}

export default NodeTerminal;
6 changes: 5 additions & 1 deletion components/workspace/cli.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ import { useTheme } from "next-themes";
import { ReactTerminal } from "react-terminal";
import { useCliCommands } from "./use-cli-commands";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "../ui/tabs";
import { NodeTerminal } from "../webcontainer";
import { LoadFiles } from "../webcontainer/load-files";
import dynamic from "next/dynamic";

const NodeTerminal = dynamic(() => import("../webcontainer/node-terminal"), {
ssr: false,
});

export default function Cli() {
const commands = useCliCommands();
Expand Down

0 comments on commit 33496fa

Please sign in to comment.