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

Unexpected SSR difference warning with SVG <filter> primitives #10772

Closed
vxna opened this issue Sep 21, 2017 · 11 comments · Fixed by #11174
Closed

Unexpected SSR difference warning with SVG <filter> primitives #10772

vxna opened this issue Sep 21, 2017 · 11 comments · Fixed by #11174

Comments

@vxna
Copy link

vxna commented Sep 21, 2017

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
I've started recieving this warning about my SVGs which is using feGaussianBlur:
Warning: Expected server HTML to contain a matching <feGaussianBlur> in <filter>.

What is the expected behavior?
Should be no warnings because there are no difference.

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
Such behavior started right after updating to React 16.0.0-rc.3 and never happened with React 15.6.1

@nhunzaker
Copy link
Contributor

cc @sebmarkbage @gaearon

Looks like the ol' SVG cares about casing but HTML doesn't is back at it again!

@gaearon
Copy link
Collaborator

gaearon commented Sep 21, 2017

Can you please provide a minimal reproducing example?

@forWorkAtML
Copy link

forWorkAtML commented Sep 29, 2017

@nhunzaker I've seen this issue recently but ignored it thinking it was my fault (react 16.0.0). In any case, if I remember correctly I had an <svg tabIndex="2">. In the browser there would appear no errors but I couldn't tab to the icon. When I did <svg tabindex="2"> I would get Invalid DOM property tabindex. Did you mean tabIndex? but I could tab to the icon. Wanted to share because it appears similar.

@gaearon
Copy link
Collaborator

gaearon commented Sep 30, 2017

No, this sounds right. React asks you to always use the React canonical naming (camelCase) even if the lowercase version "appears" to work.

@gaearon
Copy link
Collaborator

gaearon commented Sep 30, 2017

Actually wait, I'm wrong. It doesn't sound right based on your description. Could be a bug.

@gaearon
Copy link
Collaborator

gaearon commented Sep 30, 2017

I filed a new issue for the tabIndex problem: #10987.

I don't think it's related to this issue.
We still need somebody to create a reproducing fiddle for this issue.

@gaearon gaearon added Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug and removed Type: Bug labels Sep 30, 2017
@forWorkAtML
Copy link

I'll work on it today and share it in the ticket you created.

@vxna vxna changed the title Unexpected SSR difference warning with SVG attributes Unexpected SSR difference warning with SVG <filter> primitives Sep 30, 2017
@gaearon gaearon added Type: Bug and removed Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug labels Oct 3, 2017
@webcarrot
Copy link

This line:
https://github.com/facebook/react/blob/master/src/renderers/dom/fiber/ReactDOMFiberEntry.js#L444

Quick fix:

  canHydrateInstance(
    instance: Instance | TextInstance,
    type: string,
    props: Props,
  ): boolean {
    return (
      instance.nodeType === ELEMENT_NODE &&
      type.toLowerCase() === instance.nodeName.toLowerCase()
    );
  },

@gaearon
Copy link
Collaborator

gaearon commented Oct 4, 2017

Or maybe we should check the namespace, and apply case-insensitive check only to HTML.

@gaearon
Copy link
Collaborator

gaearon commented Nov 3, 2017

React 16.1.0-beta has been released. Please update react, react-dom, and react-test-renderer (if you use it) to this version and let us know if it solved the issue! We’d appreciate if you could test before Monday when we plan to get 16.1.0 out.

@krasnoperov
Copy link

In my case Warning: Expected server HTML to contain a matching <feMorphology> in <filter>. has gone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants