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.

Remix: Warning, did not expect server HTML to contain a <style> in <head>

See original GitHub issue

What package has an issue

@mantine/core

Describe the bug

When following the setup instructions for using Mantine 5.0.0 with Remix (1.6.5) (https://mantine.dev/pages/getting-started/ ), there seem to be some problems with hydration. Browser console warning as follows:

Warning, did not expect server HTML to contain a <style> in <head> This issue seems to be new to 5.0.0.

Warning is not logged when StylesPlaceholder is removed from root.tsx

Discord discussion here: https://discord.com/channels/854810300876062770/972850721244471436/1001794858798829618

minimal package.json { "private": true, "sideEffects": false, "scripts": { "build": "remix build", "dev": "remix dev", "debug": "remix dev --debug", "start": "remix-serve build" }, "dependencies": { "@emotion/react": "^11.9.3", "@emotion/server": "^11.4.0", "@mantine/core": "^5.0.0", "@mantine/hooks": "^5.0.0", "@mantine/remix": "^5.0.0", "@remix-run/node": "^1.6.5", "@remix-run/react": "^1.6.5", "@remix-run/serve": "^1.6.5", "react": "^17.0.2", "react-dom": "^17.0.2" }, "devDependencies": { "@remix-run/dev": "^1.6.5", "@remix-run/eslint-config": "^1.6.5", "@types/react": "^17.0.47", "@types/react-dom": "^17.0.17", "eslint": "^8.20.0", "typescript": "^4.7.4" }, "engines": { "node": ">=14" } }

In which browser did the problem occur

Chrome / Firefox latest

If possible, please include a link to a codesandbox with the reproduced problem

No response

Do you know how to fix the issue

No

Are you willing to participate in fixing this issue and create a pull request with the fix

No

Possible fix

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:19 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
rtivitalcommented, Aug 18, 2022

You can use mantine-remix-template, it works as expected, I doubt that there will be any solution for this any time soon as remix is very unstable – I’m not planning to waste any more time on supporting it until it become mature.

3reactions
rtivitalcommented, Aug 16, 2022

@gigobyte renderToPipeableStream is not supported by emotion, see https://github.com/emotion-js/emotion/issues/2800 If you want to use Remix with Mantine, then use template (react 17, regular ssr). As far as I understand none of current css-in -js libraries support it (see styled-components as most popular library – https://github.com/styled-components/styled-components/issues/3658). So, if you really need this feature – use plain CSS.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Warning: Did not expect server HTML to contain a <script> in ...
Adobe Experience Cloud Debugger was causing this issue for me. Disabled it and the error message went away. 1
Read more >
Did not expect server HTML to contain a <div ... - Stack Overflow
The cause was hard to find because Client and Server rendered the same HTML. My Solution:
Read more >
Did not expect server HTML to contain a <div> in <div>."-Reactjs
I was working to create a popup on the main page. I found a solution. If the modal show state comes true first,...
Read more >
React Pre-rendering and Potential Hydration Issue
Warning : Expected server HTML to contain a matching <div> in <a>. react-dom.development.js?61bb:67. I scratched my had and did what a ...
Read more >
Builder/react SDK Did not expect server HTML to contain a ...
In general the warning you shared shouldn't cause the page to not load, and I doubt it's related to the issue of not...
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