-
Notifications
You must be signed in to change notification settings - Fork 920
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build error ReferenceError: window is not defined #516
Comments
Make sure all your components are SSR-friendly. VuePress use SSR rendering to provide html files for search engines to index content, so you can only visit |
add computed: {
currentX() {
const x = (window.innerWidth - this.currentWidth) / 2
return parseSize(this.left, window.innerWidth, x)
},
currentY() {
const y = (window.innerHeight - this.currentHeight) / 2
return parseSize(this.top, window.innerHeight, Math.max(y - 50, y))
}, how to fix it? It seem not ok |
Ok,I understand. Thanks a lot |
The thing you should know that window is not reactive, and user can change window size. You should give up using computed, initialize some variable first with default value, and update them in Then you use You can create a composition if they are commonly used. You can also use These kind of issues, which is not VuePress related, should be better posted on vue forum or stackoverflow, instead of issue panel here |
yeah,I hadn't noticed that before. Thanks 🦏 |
import the third party pack, use externals Not work?
|
vuepress build docs |
@xtqjh If you have any questions, please go to the discussion panel |
Discussed in #515
Originally posted by F-one-1 November 6, 2021
Description
Hi all, I try to
"docs:build": "vuepress build docs",
but the error occur."docs:dev": "vuepress dev docs",
is OKIncident
clientAppEnhance.js
fit.js
I don't know that the problem may be in webpack or the clientAppEnhance.js config.js
The text was updated successfully, but these errors were encountered: