Browse Source

fix: 尝试修复 nuxt 报错 issue#4409

feature-copy-right-tip
wangfupeng 3 years ago
parent
commit
912f8889a1
  1. 7
      packages/editor/src/utils/node-polyfill.ts

7
packages/editor/src/utils/node-polyfill.ts

@ -30,4 +30,11 @@ if (typeof global === 'object') {
},
}
}
if (global.document != null) {
// SSR 环境下可能会报错 (issue 4409)
if (global.document.getElementsByTagName == null) {
global.document.getElementsByTagName = () => []
}
}
}
Loading…
Cancel
Save