You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am loving the simplicity of this module. What I also love is Next.js. However, those two unfortunately doesn't play well with each other.
Trying to call ky inside Next's getInitialProps throws that self is not defined, because during first request Next.js calls getInitialProps on the server.
Not sure I want to add an option for this, as it will enable users to supply a implementation that is not fully Fetch-compliant and then complain to me if something breaks. For example, unfetch is missing a lot and node-fetch is missing stuff too. I don't want to be forced to cater to those incomplete implementations.
I am loving the simplicity of this module. What I also love is Next.js. However, those two unfortunately doesn't play well with each other.
Trying to call
ky
inside Next'sgetInitialProps
throws thatself
is not defined, because during first requestNext.js
callsgetInitialProps
on the server.One possible solution would be to accept a user's
fetch
(e.g. https://www.npmjs.com/package/isomorphic-unfetch).I understand that this adds a complexity, but if you are willing to accept it, I can send a PR.
The text was updated successfully, but these errors were encountered: