Closed 810106148 closed 4 years ago
braft-finder
不支持 SSR?
@ycjcl868 请看下。
import BraftEditor from 'braft-editor' 只要引用,就出错。要怎么解决?
https://umijs.org/zh/guide/faq.html#ssr 这里的方法 不能解决。我只引用,还没使用,都会出错。
const braftFinder = typeof document !== 'undefined' ? require(''braft-editor') : {}
运行:npm start 出错: ReferenceError: document is not defined at D:\wwwroot\umi-server\examples\ant-motion\node_modules\braft-finder\dist\index.js:591:19 at D:\wwwroot\umi-server\examples\ant-motion\node_modules\braft-finder\dist\index.js:580:46 at module.exports (D:\wwwroot\umi-server\examples\ant-motion\node_modules\braft-finder\dist\index.js:645:88) at Object.defineProperty.value (D:\wwwroot\umi-server\examples\ant-motion\node_modules\braft-finder\dist\index.js:1095:37) at webpack_require (D:\wwwroot\umi-server\examples\ant-motion\node_modules\braft-finder\dist\index.js:30:30) at Object.defineProperty.value (D:\wwwroot\umi-server\examples\ant-motion\node_modules\braft-finder\dist\index.js:1116:1) at webpack_require (D:\wwwroot\umi-server\examples\ant-motion\node_modules\braft-finder\dist\index.js:30:30) at Object. (D:\wwwroot\umi-server\examples\ant-motion\node_modules\braft-finder\dist\index.js:2095:13)
at __webpack_require__ (D:\wwwroot\umi-server\examples\ant-motion\node_modules\braft-finder\dist\index.js:30:30)
at Object.defineProperty.value (D:\wwwroot\umi-server\examples\ant-motion\node_modules\braft-finder\dist\index.js:94:18)
[nodemon] app crashed - waiting for file changes before starting...