Skip to content
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

Does not work with server-side-rendering #2

Closed
sobolevn opened this issue Oct 20, 2016 · 4 comments
Closed

Does not work with server-side-rendering #2

sobolevn opened this issue Oct 20, 2016 · 4 comments

Comments

@sobolevn
Copy link

I guess it happens, because window is exposed: https://github.com/paulpflug/vue-mixins/blob/master/src/_throttledListener.coffee#L3

[20:22:54] sobolev :: MacBook-Pro-Nikita ➜ Documents/Frontends/razgrebaem ‹master*› » NODE_ENV=production ./node_modules/.bin/webpack --config build/webpack.server.conf.js --progress --hide-modules && node server
Hash: 736c9b36894982894cba
Version: webpack 1.13.2
Time: 2086ms
Asset Size Chunks Chunk Names
server-bundle.js 46.8 kB 0 [emitted] app
/Users/sobolev/Documents/Frontends/razgrebaem/node_modules/vue-mixins/_throttledListener.js:6
rAF = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;
^

ReferenceError: window is not defined
at Object. (/Users/sobolev/Documents/Frontends/razgrebaem/node_modules/vue-mixins/_throttledListener.js:6:9)
at Object. (/Users/sobolev/Documents/Frontends/razgrebaem/node_modules/vue-mixins/_throttledListener.js:32:4)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/Users/sobolev/Documents/Frontends/razgrebaem/node_modules/vue-mixins/onWindowResize.js:15:3)

@paulpflug
Copy link
Owner

ok try a new npm install, the patched version should then get installed.
please report back because I currently have not testing environment for ssr

@sobolevn
Copy link
Author

Yeap, it worked. I am using vue-side-nav.
You can see the full code here: https://github.com/wemake-services/razgrebaem.ru

But for now I have some new issue, which I will open in the appropriate repos with the link to this one.

@sobolevn
Copy link
Author

I can also push my server-side code (not really stable though), if it would help.

@sobolevn
Copy link
Author

sobolevn commented Oct 20, 2016

All in all, solved it like this: https://github.com/wemake-services/razgrebaem.ru/blob/feature-ssr/src/components/Navbar.vue#L48

Thank you for your awesome components!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants