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

ReferenceError: window is not defined #17

Open
ryanrca opened this issue Oct 11, 2019 · 1 comment
Open

ReferenceError: window is not defined #17

ryanrca opened this issue Oct 11, 2019 · 1 comment
Labels

Comments

@ryanrca
Copy link

ryanrca commented Oct 11, 2019

ReferenceError
window is not defined

All I did was import the library:

<script>
import VueThreejs from 'vue-threejs';
export default {};
</script>

Refresh the page, get that error.
Stack trace is crashing on window.webkitRequestAnimationFrame...:

};

function requestAnimationFrame(callback) {
  setTimeout(callback, 1000 / 60);
}
var requestAnimationFrame$1 = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || requestAnimationFrame;

var CenteredDiv = function () {
  function CenteredDiv() {
    classCallCheck(this, CenteredDiv);
    this.backgroundElement = document.createElement('div');
     

Maybe this library has issues working with nuxt.js?
https://stackoverflow.com/questions/40707481/window-is-not-defined-in-vue-js-2

@fritx
Copy link
Owner

fritx commented Oct 12, 2019

@ryanrca oh yes, didn't adapt it to nuxt.js yet

maybe try to wrap the <script> in a <client-only> or sth else?

@fritx fritx added the bug label Oct 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants