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.

Page Load Error with NextJS + react-simple-maps?

See original GitHub issue

Hello,

This tooltip works great, and I love it, I have it working to shade in countries meeting a criteria, but I get the following issue when the page loads, and sometimes the tooltip losing as its styling; this is the bit of the error that seems relevant.

How can I resolve this console error?

index.js:1 Warning: Prop `dangerouslySetInnerHTML` did not match. Server: "\n  \t.t51fe1a30-9bf2-44ad-a27d-331c9a5e9a33 {\n\t    color: #fff;\n\t    background: #222;\n\t    border: 1px solid transparent;\n  \t}\n\n  \t.t51fe1a30-9bf2-44ad-a27d-331c9a5e9a33.place-top {\n        margin-top: -10px;\n    }\n    .t51fe1a30-9bf2-44ad-a27d-331c9a5e9a33.place-top::before {\n        border-top: 8px solid transparent;\n    }\n    .t51fe1a30-9bf2-44ad-a27d-331c9a5e9a33.place-top::after {\n        border-left: 8px solid transparent;\n        border-right: 8px solid transparent;\n        bottom: -6px;\n        left: 50%;\n        margin-left: -8px;\n        border-top-color: #222;\n        border-top-style: solid;\n        border-top-width: 6px;\n    }\n\n    .t51fe1a30-9bf2-44ad-a27d-331c9a5e9a33.place-bottom {\n        margin-top: 10px;\n    }\n    .t51fe1a30-9bf2-44ad-a27d-331c9a5e9a33.place-bottom::before {\n        border-bottom: 8px solid transparent;\n    }\n    .t51fe1a30-9bf2-44ad-a27d-331c9a5e9a33.place-bottom::after {\n        border-left: 8px solid transparent;\n        border-right: 8px solid transparent;\n        top: -6px;\n        left: 50%;\n        margin-left: -8px;\n        border-bottom-color: #222;\n        border-bottom-style: solid;\n        border-bottom-width: 6px;\n    }\n\n    .t51fe1a30-9bf2-44ad-a27d-331c9a5e9a33.place-left {\n        margin-left: -10px;\n    }\n    .t51fe1a30-9bf2-44ad-a27d-331c9a5e9a33.place-left::before {\n        border-left: 8px solid transparent;\n    }\n    .t51fe1a30-9bf2-44ad-a27d-331c9a5e9a33.place-left::after {\n        border-top: 5px solid transparent;\n        border-bottom: 5px solid transparent;\n        right: -6px;\n        top: 50%;\n        margin-top: -4px;\n        border-left-color: #222;\n        border-left-style: solid;\n        border-left-width: 6px;\n    }\n\n    .t51fe1a30-9bf2-44ad-a27d-331c9a5e9a33.place-right {\n        margin-left: 10px;\n    }\n    .t51fe1a30-9bf2-44ad-a27d-331c9a5e9a33.place-right::before {\n        border-right: 8px solid transparent;\n    }\n    .t51fe1a30-9bf2-44ad-a27d-331c9a5e9a33.place-right::after {\n        border-top: 5px solid transparent;\n        border-bottom: 5px solid transparent;\n        left: -6px;\n        top: 50%;\n        margin-top: -4px;\n        border-right-color: #222;\n        border-right-style: solid;\n        border-right-width: 6px;\n    }\n  " Client: "\n  \t.t6d4140a3-b207-4e70-8cca-53761fb541be {\n\t    color: #fff;\n\t    background: #222;\n\t    border: 1px solid transparent;\n  \t}\n\n  \t.t6d4140a3-b207-4e70-8cca-53761fb541be.place-top {\n        margin-top: -10px;\n    }\n    .t6d4140a3-b207-4e70-8cca-53761fb541be.place-top::before {\n        border-top: 8px solid transparent;\n    }\n    .t6d4140a3-b207-4e70-8cca-53761fb541be.place-top::after {\n        border-left: 8px solid transparent;\n        border-right: 8px solid transparent;\n        bottom: -6px;\n        left: 50%;\n        margin-left: -8px;\n        border-top-color: #222;\n        border-top-style: solid;\n        border-top-width: 6px;\n    }\n\n    .t6d4140a3-b207-4e70-8cca-53761fb541be.place-bottom {\n        margin-top: 10px;\n    }\n    .t6d4140a3-b207-4e70-8cca-53761fb541be.place-bottom::before {\n        border-bottom: 8px solid transparent;\n    }\n    .t6d4140a3-b207-4e70-8cca-53761fb541be.place-bottom::after {\n        border-left: 8px solid transparent;\n        border-right: 8px solid transparent;\n        top: -6px;\n        left: 50%;\n        margin-left: -8px;\n        border-bottom-color: #222;\n        border-bottom-style: solid;\n        border-bottom-width: 6px;\n    }\n\n    .t6d4140a3-b207-4e70-8cca-53761fb541be.place-left {\n        margin-left: -10px;\n    }\n    .t6d4140a3-b207-4e70-8cca-53761fb541be.place-left::before {\n        border-left: 8px solid transparent;\n    }\n    .t6d4140a3-b207-4e70-8cca-53761fb541be.place-left::after {\n        border-top: 5px solid transparent;\n        border-bottom: 5px solid transparent;\n        right: -6px;\n        top: 50%;\n        margin-top: -4px;\n        border-left-color: #222;\n        border-left-style: solid;\n        border-left-width: 6px;\n    }\n\n    .t6d4140a3-b207-4e70-8cca-53761fb541be.place-right {\n        margin-left: 10px;\n    }\n    .t6d4140a3-b207-4e70-8cca-53761fb541be.place-right::before {\n        border-right: 8px solid transparent;\n    }\n    .t6d4140a3-b207-4e70-8cca-53761fb541be.place-right::after {\n        border-top: 5px solid transparent;\n        border-bottom: 5px solid transparent;\n        left: -6px;\n        top: 50%;\n        margin-top: -4px;\n        border-right-color: #222;\n        border-right-style: solid;\n        border-right-width: 6px;\n    }\n  "
    in style (created by ReactTooltip)
    in div (created by ReactTooltip)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

47reactions
damianhodgkisscommented, Apr 27, 2020

The same thing with next, resolved the error by passing a static UUID but still no styling.

Edit: needed to use a non-numeric UUID as the class name generated matches the UUID which cant be a number. Something like this works in Next.

<ReactTooltip effect="solid" uuid="mytt" />

9reactions
Garlinkcommented, Feb 4, 2021

For those who are interested in solving this on Next.js (10.0.6), take a look at THIS.

In this case, I solved that warning and also the issues with tooltip position by including on _app.js like so: const ReactTooltip = dynamic(() => import('react-tooltip'), { ssr: false });

Then, just: <ReactTooltip />

So, no need to setting up uuid.

Not sure if is the best approach, but at least it’s solved for now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Page Load Error with NextJS + react-simple-maps? · Issue #587
Hello, This tooltip works great, and I love it, I have it working to shade in countries meeting a criteria, but I get...
Read more >
Advanced Features: Error Handling - Next.js
Error Handling. This documentation explains how you can handle development, server-side, and client-side errors. Handling Errors in Development.
Read more >
React simple maps load topo-json parse issue - Stack Overflow
When loading topojson files using geographyUrl in the create-react-app environment, you have to place it in the public folder.
Read more >
Getting started - React Simple Maps
In order to get started with react-simple-maps, you will need two things. A working react app (e.g. create-react-app, or next.js); A topojson or...
Read more >
React Google Maps Api Style Guide
LoadScript - Loads the Google Maps API script; GoogleMap - The map component inside which all other components render. The simplest way to...
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