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.

[BUG] React DOM Server Fails to Render Animated Elements

See original GitHub issue

Issue

When you call ReactDOMServer.renderToStaticMarkup() with a component that uses framer-motion to render it fails to render those elements but renders non-animated elements correctly. Even with passing { type: false } to the transition it still fails.

Example

Notes on example:

  • This example uses puppeteer but it also produced the same result with nextjs
  • All of the elements that are not rendered by motion are rendered fine (you can see the axis) but the motion.rect are not rendered.

Versions

"react": "16.9.0"
"react-dom": "16.9.0"
"framer-motion": "^1.6.7"

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:11

github_iconTop GitHub Comments

2reactions
mattgperrycommented, Sep 27, 2019

Hmm that’s odd, we have SSR-specific tests that work fine. I’ll take a look.

0reactions
mattgperrycommented, Sep 28, 2020

If I passed animate I got the same result, a <rect>

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is using AnimatePresence from framer motion causing ...
The error only occurs when using AnimatePresence. Server Error Error: Element type is invalid: expected a string (for built-in components) ...
Read more >
Debugging and fixing hydration issues - somewhat abstract
It is almost working beautifully, but when we tried to hydrate our SSR (server-side rendered) result, we hit a snag; our SSR result...
Read more >
ReactDOMServer – React
The ReactDOMServer object enables you to render components to static markup. Typically, it's used on a Node server: // ES modules import *...
Read more >
8 common React error messages and how to address them
Learn about the most common error messages in React Development and the meaning behind them, the error itself, and how to fix it....
Read more >
Troubleshooting | React Navigation
You can install the latest versions by installing the packages again (e.g. npm install package-name ). I'm getting an error "Unable to resolve...
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