-
-
Notifications
You must be signed in to change notification settings - Fork 156
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
Error: Network error: window is not defined #3
Comments
Ahh! Great point, it's a bug, and should be easy to fix. I'll get onto it. |
Turns out this will be fixed when this issue is fixed for both the client and server projects. Basically in the last major version before I added query batching support, apollo-upload-server and apollo-upload-client reverted to the standard transport system for requests that do not have uploads. I wanted to add those smarts back this weekend, but I ran out of time. I created apollo-upload-examples for the duel purpose of helping people understand the setup, but also for us to have a somewhat realistic project to develop against. Until now I have been stashing my work on a real project and developing these packages against it, which has been a bit inconvenient. It's not linked in any readmes yet. If you would like to help out, we need to add another multiple file upload example component and mutation. We should also replace the placeholder query with something better, and use it on the page so that we can see SSR works ok. Perhaps instead of just console logging uploads in the resolvers, we could add them to a dummy database, something JSON based? I feel like I have seen a dummy database in an example Apollo project somewhere before. The query could then display all the uploads on the page in a list component. |
@michaelmerrill Working ok, with the new version? |
Hi Jay,
I'm pretty sure this is an error on my end, but if you have any advice I would love to hear it. I'm using next.js with apollo-client and getting 'window is not defined' when I switch to the new createNetworkInterface.
{ Error: Network error: window is not defined at new ApolloError (/Users/michaelmerrill/code/src/github.com/michaelmerrill/snapflix-client/node_modules/apollo-client/src/errors/ApolloError.js:32:28) at /Users/michaelmerrill/code/src/github.com/michaelmerrill/snapflix-client/node_modules/apollo-client/src/core/QueryManager.js:260:41 at /Users/michaelmerrill/code/src/github.com/michaelmerrill/snapflix-client/node_modules/apollo-client/src/core/QueryManager.js:683:25 at Array.forEach (native) at /Users/michaelmerrill/code/src/github.com/michaelmerrill/snapflix-client/node_modules/apollo-client/src/core/QueryManager.js:680:27 at Array.forEach (native) at QueryManager.broadcastQueries (/Users/michaelmerrill/code/src/github.com/michaelmerrill/snapflix-client/node_modules/apollo-client/src/core/QueryManager.js:677:42) at Array.<anonymous> (/Users/michaelmerrill/code/src/github.com/michaelmerrill/snapflix-client/node_modules/apollo-client/src/core/QueryManager.js:63:23) at dispatch (/Users/michaelmerrill/code/src/github.com/michaelmerrill/snapflix-client/node_modules/redux/lib/createStore.js:186:19) at /Users/michaelmerrill/code/src/github.com/michaelmerrill/snapflix-client/node_modules/apollo-client/src/ApolloClient.js:174:30 graphQLErrors: [], networkError: ReferenceError: window is not defined at HTTPUploadNetworkInterface.fetchFromRemoteEndpoint (/Users/michaelmerrill/code/src/github.com/michaelmerrill/snapflix-client/node_modules/apollo-upload-client/src/network-interface.js:6:26) at /Users/michaelmerrill/code/src/github.com/michaelmerrill/snapflix-client/node_modules/apollo-client/src/transport/networkInterface.js:108:71, message: 'Network error: window is not defined', extraInfo: undefined, queryErrors: [ [Circular] ] }
The text was updated successfully, but these errors were encountered: