Closed center-777 closed 5 years ago
Hm, that is unexpected. Can you go to that line and let me know what this
is?
We experience the same error. this
seems to be defined correctly defined but _onpopstate
is undefined at this point and therefore can't be bound.
The only thing I could spot why that might be is the following piece of code:
Page.prototype._onpopstate = (function () {
var loaded = false;
if ( ! hasWindow ) {
return;
}
which evaluates to false
and returns undefined
instead of a function which could be bound.
Update: for our tests this only happens if they run without @jest-environment jsdom
which provides a dom environment and defines a window
object.
@flootr Can you confirm that returning a function there instead fixes it? return function(){};
should be enough.
@matthewp that does indeed help. Can't speak for the issue author though.
When will this actually make it out. When I do a npm install for my project, I get 1.10.0 down and I get this error as well. I know it was fixed but just wondering when this will make it live?
I'll do a release today.
Released in 1.10.2
@matthewp not sure what went wrong but 1.10.2 doesn't seem to include that fix. Ha, it seems my PR from above only fixed it for page.js
, not index.js
and index.mjs
🤔
Oh, sorry I didn't look at that closely enough. page.js
and page.mjs
get generated from index.js
. So changes should be made to index.js
. I'll reopen since this is not fixed.
Thanks for looking into this.
After upgrade to![image](https://user-images.githubusercontent.com/7359520/45222173-62717a80-b2bc-11e8-9616-3f28aa05f13e.png)
1.10.0
i got an error:https://github.com/visionmedia/page.js/blob/v1.10.0/index.js#L53