fix: quilleditor ssr加载失败

This commit is contained in:
liuweiqing 2024-02-25 10:27:33 +08:00
parent a3a499a438
commit 8a25248c29
3 changed files with 21 additions and 2 deletions

View File

@ -1,8 +1,12 @@
"use client";
import dynamic from "next/dynamic";
import ReduxProvider from "@/app/store/ReduxProvider";
import QEditor from "@/components/QuillEditor";
// import QEditor from "@/components/QuillEditor";
// 动态导入 QuillEditor 组件,禁用 SSR
const QEditor = dynamic(() => import("@/components/QuillEditor"), {
ssr: false,
});
export default function QuillWrapper({ lng }) {
return (
<ReduxProvider>

14
package-lock.json generated
View File

@ -34,6 +34,7 @@
"next-redux-wrapper": "^8.1.0",
"openai": "^4.24.3",
"postcss": "8.4.35",
"punycode": "^2.3.1",
"quill": "^1.3.7",
"quill-to-word": "^1.3.0",
"raw-body": "^2.5.2",
@ -3278,6 +3279,14 @@
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
},
"node_modules/punycode": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
"integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==",
"engines": {
"node": ">=6"
}
},
"node_modules/queue-microtask": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
@ -6842,6 +6851,11 @@
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
},
"punycode": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
"integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg=="
},
"queue-microtask": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",

View File

@ -33,6 +33,7 @@
"next-redux-wrapper": "^8.1.0",
"openai": "^4.24.3",
"postcss": "8.4.35",
"punycode": "^2.3.1",
"quill": "^1.3.7",
"quill-to-word": "^1.3.0",
"raw-body": "^2.5.2",