Skip to content

Commit 79276ed

Browse files
committed
Fix compiler error related to DOMPurify
DOM on the server and on the client are different, so a wrapper around the DOMPurify library call is needed. This commit installs the isomorphic dompurify package, which solves the compiler error.
1 parent 8d5b39e commit 79276ed

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

peerprep/app/questions/[question]/[roomID]/question.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import styles from "@/style/question.module.css";
77
import { useRouter } from "next/navigation";
88
import { deleteQuestion } from "@/app/api/internal/questions/helper";
99
import CollabEditor from "@/components/questionpage/CollabEditor";
10-
import DOMPurify from "dompurify";
10+
import DOMPurify from "isomorphic-dompurify";
1111

1212
interface Props {
1313
question: Question;

peerprep/app/questions/[question]/question.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import styles from "@/style/question.module.css";
77
import { useRouter } from "next/navigation";
88
import { deleteQuestion } from "@/app/api/internal/questions/helper";
99
import CollabEditor from "@/components/questionpage/CollabEditor";
10-
import DOMPurify from "dompurify";
10+
import DOMPurify from "isomorphic-dompurify";
1111

1212
interface Props {
1313
question: Question;

peerprep/package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)