question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Combining _document with redux connect or apollo

See original GitHub issue

I am trying to combine one of the style examples with-aphrodite and with-apollo-and-redux It seems that _document.js does not work along with the withData wrapper as expected.

Error: Cannot automatically buffer without a document
    at injectGeneratedCSSOnce (/Users/Max/Development/testrepo/node_modules/aphrodite/lib/inject.js:168:19)
    at injectStyleOnce (/Users/Max/Development/testrepo/node_modules/aphrodite/lib/inject.js:194:5)
    at injectAndGetClassName (/Users/Max/Development/testrepo/node_modules/aphrodite/lib/inject.js:287:5)
    at css (/Users/Max/Development/testrepo/node_modules/aphrodite/lib/exports.js:146:54)
    at exports.default (/Users/Max/Development/testrepo/.next/dist/components/layout/configuration/Languages.js:44:34)
    at walkTree (/Users/Max/Development/testrepo/node_modules/react-apollo/lib/server.js:34:21)
    at walkTree (/Users/Max/Development/testrepo/node_modules/react-apollo/lib/server.js:37:13)
    at walkTree (/Users/Max/Development/testrepo/node_modules/react-apollo/lib/server.js:37:13)
    at getQueriesFromTree (/Users/Max/Development/testrepo/node_modules/react-apollo/lib/server.js:58:5)
    at getDataFromTree (/Users/Max/Development/testrepo/node_modules/react-apollo/lib/server.js:73:19)```

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
dzek69commented, Jun 4, 2017

Any ideas on this?

on getInitialProps of my route I am deciding in which language the page will be displayed and I want to fill <html> lang attribute with proper value. The value is being stored in the Redux store

1reaction
timneutkenscommented, May 15, 2017

Okay, re-opening 👌

Read more comments on GitHub >

github_iconTop Results From Across the Web

Redux to Apollo: Data Access Patterns
Redux isn't a very complicated library, it essentially boils down to a single object {} that stores all of your application's state and...
Read more >
Combining _document with redux connect or apollo #1970
I am trying to combine one of the style examples with-aphrodite and with-apollo-and-redux It seems that _document.js does not work along ...
Read more >
How to use Redux with Apollo Client and GraphQL in React
When having a GraphQL server, Apollo Client can be a valid option for your remote data. How fits Redux into the equation?
Read more >
Is good approach to combine Next.js with redux and apollo ...
If you want to use your Redux and Apollo state in a component, you need to use both graphql from react-apollo and connect...
Read more >
Combining Redux & Apollo Containers - Atomic Spin
A common pattern is to make a GraphQL query with data from the Redux state. You can do so by chaining Redux and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found