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

Invalid DOM property on SVG transform-origin #53342

Open
1 task done
oliviertassinari opened this issue Jul 29, 2023 · 5 comments
Open
1 task done

Invalid DOM property on SVG transform-origin #53342

oliviertassinari opened this issue Jul 29, 2023 · 5 comments
Labels
bug Issue was opened via the bug report template.

Comments

@oliviertassinari
Copy link
Contributor

oliviertassinari commented Jul 29, 2023

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

    Operating System:
      Platform: linux
      Arch: x64
      Version: #22 SMP Tue Jan 10 18:39:00 UTC 2023
    Binaries:
      Node: 18.14.2
      npm: 9.5.0
      Yarn: 1.22.19
      pnpm: N/A
    Relevant Packages:
      next: 13.4.13-canary.6
      eslint-config-next: 13.4.12
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 5.0.4
    Next.js Config:
      output: N/A

Which area(s) of Next.js are affected? (leave empty if unsure)

No response

Link to the code that reproduces this issue or a replay of the bug

https://codesandbox.io/p/sandbox/jolly-zhukovsky-7k74qp?file=/app/page.tsx:9,18

import * as React from "react";

export default function BasicLineChart() {
  return (
    <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 300">
      <rect x="0" y="0" width="300" height="300" fill="white" />
      <g transform="scale(-1, 1)" transform-origin="center">
        <rect
          x="50%"
          y="35"
          width="39"
          height="30"
          fill="#007BA4"
          transform="scale(1, 1)"
          transform-origin="center"
        />
        <text
          x="50%"
          y="35"
          transform="translate(19.5, 15) scale(-1, 1)"
          transform-origin="center"
          text-anchor="middle"
          dy="4"
          fill="white"
        >
          -13
        </text>
      </g>
    </svg>
  );
}

To Reproduce

Open the console

Describe the Bug

The Next.js App Router gets confused:

Invalid DOM property transform-origin. Did you mean transformOrigin?

Screenshot 2023-07-29 at 23 43 50

Expected Behavior

Like in the Next.js Page Router, no warnings

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

I noticed this while playing with https://mui.com/x/react-charts/lines/#data-format.

@oliviertassinari oliviertassinari added the bug Issue was opened via the bug report template. label Jul 29, 2023
@oliviertassinari oliviertassinari changed the title Invalid DOM property transform-origin. Did you mean transformOrigin? Invalid DOM property on SVG transform-origin Jul 29, 2023
@aidev0007
Copy link

Hello have you fixed it? I am having the same problem Invalid DOM property transform-origin. Did you mean transformOrigin?

@ajaykumareminence
Copy link

i am getting the same error while using @mui/x-charts..

@zfralish
Copy link

zfralish commented Oct 4, 2023

I am also having this issue with @mui/x-charts

@ZoeLeee
Copy link

ZoeLeee commented Oct 20, 2023

I am also having this issue with @blueprintjs/icons

@m7kvqbe1
Copy link

m7kvqbe1 commented Apr 30, 2024

Also having this issue with components generated using @svgr/cli

transform-origin is a valid SVG HTML attribute:

https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/transform-origin

I guess the problem lies with the JSX output from svgr. It should be applying the attribute in camelCase.

This seems to be an issue with next - which is wrongly throwing an error for the transform-origin property.

The React runtime has been happy with it for over a year:

https://github.com/facebook/react/pull/26130/files#diff-67b481b96d526280780f010dfd192761f2d1f6dc812e3015020a7986501d2ebaR524

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

No branches or pull requests

6 participants