Skip to content

Commit

Permalink
fix: 尝试修复 nuxt 报错 issue#4409
Browse files Browse the repository at this point in the history
  • Loading branch information
wangfupeng1988 committed Jul 11, 2022
1 parent c803ed7 commit 722b100
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/editor/src/utils/node-polyfill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,10 @@ if (typeof global === 'object') {
}
}
}

if (global.document != null) {
// SSR 环境下可能会报错 (issue 4409)
if (global.document.getElementsByTagName == null) {
global.document.getElementsByTagName = () => []
}
}

0 comments on commit 722b100

Please sign in to comment.