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

Did not expect server HTML to contain a <span> in <div> using redux-saga #5367

Closed
francisrod01 opened this issue Oct 2, 2018 · 5 comments
Closed
Labels
good first issue Easy to fix issues, good for newcomers

Comments

@francisrod01
Copy link
Contributor

Examples bug report

Example name

with-redux-saga:
https://github.com/zeit/next.js/tree/canary/examples/with-redux-saga

Describe the bug

I receive the content from serve and show on the screen but the console shows a red warning with the exactly text rendered by redux.

To Reproduce

I have a real demo on CodeSandbox:
https://codesandbox.io/s/y16j84949

Expected behavior

I expect a correct rendering in server and client.

Screenshots

image

System information

  • OS: Linux debian 3.16.0-6-amd64 Added css using aphrodite #1 SMP Debian 3.16.57-2 (2018-07-14) x86_64 GNU/Linux
  • Browser : chrome Version 69.0.3497.100 (Official Build) (64-bit)
  • Version of Next.js: 1.0.3
@timneutkens timneutkens added help wanted good first issue Easy to fix issues, good for newcomers labels Oct 17, 2018
@rus-yurchenko
Copy link

rus-yurchenko commented Oct 24, 2018

I have a similar issue: Did not expect server HTML to contain a <span> in <span>. I'm not using redux-saga. The following warning show only in Safari.

Browser: Safari Version 12.0 (14606.1.36.1.9)
Next.js version: 7.0.2

@drex44
Copy link

drex44 commented Oct 27, 2018

Hi, @francisrod01 this warning is given by react. It is because your app is somehow initially rendering a different tree on the client vs the server. you can read about it here on stackoverflow.

The warning is due to the call to the store.dispatch in getInitialProps. Somehow it results in two different nodes on server and client. due to this react identifies it as different node and could not compare it properly for updation.

One solution I found is to set the initial store value for translation instead of an empty object. I forked and have set the initial value in this codesandbox. It resolves this warning.

This issue is somewhat different but will help you understand better,
facebook/react#10879.

@mfix22
Copy link

mfix22 commented Feb 22, 2019

@timneutkens this can be closed as the error is no longer shown in the the with-redux-saga example

@sayjeyhi
Copy link

In my case it was because of using PersistGate and react-loadable. if you using this libraries, you could use preloadAll instead of preloadReady

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Easy to fix issues, good for newcomers
Projects
None yet
Development

No branches or pull requests

7 participants