ReferenceError: window is not defined #1298
-
使用webpack打包的时候提示这个错误 if(!__VUEPRESS_SSR__){
window...
} 错误提示 ReferenceError: window is not defined
at Object.70464 (/Users/mac/Documents/blog/src/.vuepress/.temp/.server/464.app.cjs:1602:31)
at __webpack_require__ (/Users/mac/Documents/blog/src/.vuepress/.temp/.server/app.cjs:24750:42)
at Module.14350 (/Users/mac/Documents/blog/src/.vuepress/.temp/.server/5999.app.cjs:26:22)
at Function.__webpack_require__ (/Users/mac/Documents/blog/src/.vuepress/.temp/.server/app.cjs:24750:42)
at async Promise.all (index 1)
at async /Users/mac/Documents/blog/src/.vuepress/.temp/.server/app.cjs:25138:55 点击里面的报错代码 var requestAnimationFrame$1 = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || requestAnimationFrame; |
Beta Was this translation helpful? Give feedback.
Answered by
Mister-Hope
Apr 13, 2023
Replies: 1 comment 2 replies
-
你的这段代码还是涉及到 windows 了,尝试不要让这段代码直接运行。这段代码可能来自于依赖,如果是请使用 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reference:
For components it's the same: