Title: Remix: Hydration errors using 7.8.0 · Issue #5490 · getsentry/sentry-javascript · GitHub
Open Graph Title: Remix: Hydration errors using 7.8.0 · Issue #5490 · getsentry/sentry-javascript
X Title: Remix: Hydration errors using 7.8.0 · Issue #5490 · getsentry/sentry-javascript
Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using the latest SDK release https://github.com/...
Open Graph Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
X Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/5490
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Remix: Hydration errors using 7.8.0","articleBody":"### Is there an existing issue for this?\r\n\r\n- [X] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues\r\n- [X] I have reviewed the documentation https://docs.sentry.io/\r\n- [X] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases\r\n\r\n### How do you use Sentry?\r\n\r\nSentry Saas (sentry.io)\r\n\r\n### Which package are you using?\r\n\r\n@sentry/remix\r\n\r\n### SDK Version\r\n\r\n7.8.0\r\n\r\n### Framework Version\r\n\r\nRemix 1.6.5\r\n\r\n### Link to Sentry event\r\n\r\n_No response_\r\n\r\n### Steps to Reproduce\r\n\r\n1. Create a new remix app using the indie template: `npx create-remix` (this also happens if you use the \"just the basics\", but then add a `links` functions to your root).\r\n2. Add the `Sentry.init(...)` code to `entry.server.tsx` as described in the documentation.\r\n3. `npm run dev`\r\n\r\n### Expected Result\r\n\r\nNo hydration errors.\r\n\r\n### Actual Result\r\n\r\nServer-rendered pages cause hydration issues. This did not happen with 7.7.0.\r\n\r\nWith a \"just the basics\" template and one stylesheet in the `links` function I now get this in the browser console:\r\n\r\n```\r\nWarning: Expected server HTML to contain a matching \u003clink> in \u003chead>.\r\n at link\r\n at Links (http://localhost:3000/build/_shared/chunk-Z4IMO2RH.js:2938:7)\r\n at head\r\n at html\r\n at App\r\n at SentryRoot (http://localhost:3000/build/_shared/chunk-Z4IMO2RH.js:8253:20)\r\n at ErrorBoundary (http://localhost:3000/build/_shared/chunk-Z4IMO2RH.js:8120:5)\r\n at errorBoundary(SentryRoot)\r\n at RemixRoute (http://localhost:3000/build/_shared/chunk-Z4IMO2RH.js:2782:3)\r\n at Routes2 (http://localhost:3000/build/_shared/chunk-Z4IMO2RH.js:2765:7)\r\n at Router (http://localhost:3000/build/_shared/chunk-Z4IMO2RH.js:962:15)\r\n at RemixCatchBoundary (http://localhost:3000/build/_shared/chunk-Z4IMO2RH.js:1272:10)\r\n at RemixErrorBoundary (http://localhost:3000/build/_shared/chunk-Z4IMO2RH.js:1197:5)\r\n at RemixEntry (http://localhost:3000/build/_shared/chunk-Z4IMO2RH.js:2662:12)\r\n at RemixBrowser (http://localhost:3000/build/_shared/chunk-Z4IMO2RH.js:3404:27)\r\n(anonymous) @ instrument.ts:123\r\nprintWarning @ react-dom.development.js:67\r\nerror @ react-dom.development.js:43\r\nwarnForInsertedHydratedElement @ react-dom.development.js:9733\r\ndidNotFindHydratableInstance @ react-dom.development.js:10512\r\ninsertNonHydratedInstance @ react-dom.development.js:14509\r\ntryToClaimNextHydratableInstance @ react-dom.development.js:14596\r\nupdateHostComponent @ react-dom.development.js:17610\r\nbeginWork @ react-dom.development.js:19080\r\nbeginWork$1 @ react-dom.development.js:23940\r\nperformUnitOfWork @ react-dom.development.js:22776\r\nworkLoopSync @ react-dom.development.js:22707\r\nrenderRootSync @ react-dom.development.js:22670\r\nperformSyncWorkOnRoot @ react-dom.development.js:22293\r\nscheduleUpdateOnFiber @ react-dom.development.js:21881\r\nupdateContainer @ react-dom.development.js:25482\r\n(anonymous) @ react-dom.development.js:26021\r\nunbatchedUpdates @ react-dom.development.js:22431\r\nlegacyRenderSubtreeIntoContainer @ react-dom.development.js:26020\r\nhydrate2 @ react-dom.development.js:26086\r\n(anonymous) @ entry.client.tsx:23\r\n```\r\n\r\nUsing the indie template, I get a bunch of errors:\r\n```\r\nWarning: Expected server HTML to contain a matching \u003clink> in \u003chead>.\r\n at link\r\n at Links (http://localhost:3000/build/_shared/chunk-XOSPV4IN.js:2743:7)\r\n at head\r\n at html\r\n at App\r\n at SentryRoot (http://localhost:3000/build/_shared/chunk-6QXZE7SL.js:4990:20)\r\n at ErrorBoundary (http://localhost:3000/build/_shared/chunk-6QXZE7SL.js:4857:5)\r\n at errorBoundary(SentryRoot)\r\n at RemixRoute (http://localhost:3000/build/_shared/chunk-XOSPV4IN.js:2587:3)\r\n at Routes2 (http://localhost:3000/build/_shared/chunk-XOSPV4IN.js:2570:7)\r\n at Router (http://localhost:3000/build/_shared/chunk-XOSPV4IN.js:679:15)\r\n at RemixCatchBoundary (http://localhost:3000/build/_shared/chunk-XOSPV4IN.js:1074:10)\r\n at RemixErrorBoundary (http://localhost:3000/build/_shared/chunk-XOSPV4IN.js:999:5)\r\n at RemixEntry (http://localhost:3000/build/_shared/chunk-XOSPV4IN.js:2467:12)\r\n at RemixBrowser (http://localhost:3000/build/_shared/chunk-XOSPV4IN.js:3225:27)\r\n(anonymous) @ instrument.ts:123\r\noverrideMethod @ react_devtools_backend.js:4026\r\nprintWarning @ react-dom.development.js:86\r\nerror @ react-dom.development.js:60\r\nwarnForInsertedHydratedElement @ react-dom.development.js:10499\r\ndidNotFindHydratableInstance @ react-dom.development.js:11458\r\nwarnNonhydratedInstance @ react-dom.development.js:12385\r\ntryToClaimNextHydratableInstance @ react-dom.development.js:12534\r\nupdateHostComponent @ react-dom.development.js:19902\r\nbeginWork @ react-dom.development.js:21618\r\nbeginWork$1 @ react-dom.development.js:27426\r\nperformUnitOfWork @ react-dom.development.js:26557\r\nworkLoopConcurrent @ react-dom.development.js:26543\r\nrenderRootConcurrent @ react-dom.development.js:26505\r\nperformConcurrentWorkOnRoot @ react-dom.development.js:25738\r\nworkLoop @ scheduler.development.js:266\r\nflushWork @ scheduler.development.js:239\r\nperformWorkUntilDeadline @ scheduler.development.js:533\r\n\r\nUncaught Error: Hydration failed because the initial UI does not match what was rendered on the server.\r\n at throwOnHydrationMismatch (react-dom.development.js:12507:9)\r\n at tryToClaimNextHydratableInstance (react-dom.development.js:12535:7)\r\n at updateHostComponent (react-dom.development.js:19902:5)\r\n at beginWork (react-dom.development.js:21618:14)\r\n at HTMLUnknownElement.callCallback2 (react-dom.development.js:4164:14)\r\n at HTMLUnknownElement.sentryWrapped (index.js:95:1)\r\n at Object.invokeGuardedCallbackDev (react-dom.development.js:4213:16)\r\n at invokeGuardedCallback (react-dom.development.js:4277:31)\r\n at beginWork$1 (react-dom.development.js:27451:7)\r\n at performUnitOfWork (react-dom.development.js:26557:12)\r\n at workLoopConcurrent (react-dom.development.js:26543:5)\r\n at renderRootConcurrent (react-dom.development.js:26505:7)\r\n at performConcurrentWorkOnRoot (react-dom.development.js:25738:38)\r\n at workLoop (scheduler.development.js:266:34)\r\n at flushWork (scheduler.development.js:239:14)\r\n at MessagePort.performWorkUntilDeadline (scheduler.development.js:533:21)\r\nthrowOnHydrationMismatch @ react-dom.development.js:12507\r\ntryToClaimNextHydratableInstance @ react-dom.development.js:12535\r\nupdateHostComponent @ react-dom.development.js:19902\r\nbeginWork @ react-dom.development.js:21618\r\ncallCallback2 @ react-dom.development.js:4164\r\nsentryWrapped @ index.js:95\r\ninvokeGuardedCallbackDev @ react-dom.development.js:4213\r\ninvokeGuardedCallback @ react-dom.development.js:4277\r\nbeginWork$1 @ react-dom.development.js:27451\r\nperformUnitOfWork @ react-dom.development.js:26557\r\nworkLoopConcurrent @ react-dom.development.js:26543\r\nrenderRootConcurrent @ react-dom.development.js:26505\r\nperformConcurrentWorkOnRoot @ react-dom.development.js:25738\r\nworkLoop @ scheduler.development.js:266\r\nflushWork @ scheduler.development.js:239\r\nperformWorkUntilDeadline @ scheduler.development.js:533\r\n\r\nWarning: An error occurred during hydration. The server HTML was replaced with client content in \u003c#document>.\r\n\r\nUncaught Error: Hydration failed because the initial UI does not match what was rendered on the server.\r\n at throwOnHydrationMismatch (react-dom.development.js:12507:9)\r\n at tryToClaimNextHydratableInstance (react-dom.development.js:12535:7)\r\n at updateHostComponent (react-dom.development.js:19902:5)\r\n at beginWork (react-dom.development.js:21618:14)\r\n at beginWork$1 (react-dom.development.js:27426:14)\r\n at performUnitOfWork (react-dom.development.js:26557:12)\r\n at workLoopConcurrent (react-dom.development.js:26543:5)\r\n at renderRootConcurrent (react-dom.development.js:26505:7)\r\n at performConcurrentWorkOnRoot (react-dom.development.js:25738:38)\r\n at workLoop (scheduler.development.js:266:34)\r\n at flushWork (scheduler.development.js:239:14)\r\n at MessagePort.performWorkUntilDeadline (scheduler.development.js:533:21)\r\nthrowOnHydrationMismatch @ react-dom.development.js:12507\r\ntryToClaimNextHydratableInstance @ react-dom.development.js:12535\r\nupdateHostComponent @ react-dom.development.js:19902\r\nbeginWork @ react-dom.development.js:21618\r\nbeginWork$1 @ react-dom.development.js:27426\r\nperformUnitOfWork @ react-dom.development.js:26557\r\nworkLoopConcurrent @ react-dom.development.js:26543\r\nrenderRootConcurrent @ react-dom.development.js:26505\r\nperformConcurrentWorkOnRoot @ react-dom.development.js:25738\r\nworkLoop @ scheduler.development.js:266\r\nflushWork @ scheduler.development.js:239\r\nperformWorkUntilDeadline @ scheduler.development.js:533\r\n\r\nUncaught Error: There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering.\r\n at updateHostRoot (react-dom.development.js:19849:57)\r\n at beginWork (react-dom.development.js:21615:14)\r\n at beginWork$1 (react-dom.development.js:27426:14)\r\n at performUnitOfWork (react-dom.development.js:26557:12)\r\n at workLoopSync (react-dom.development.js:26466:5)\r\n at renderRootSync (react-dom.development.js:26434:7)\r\n at recoverFromConcurrentError (react-dom.development.js:25850:20)\r\n at performConcurrentWorkOnRoot (react-dom.development.js:25750:22)\r\n at workLoop (scheduler.development.js:266:34)\r\n at flushWork (scheduler.development.js:239:14)\r\n at MessagePort.performWorkUntilDeadline (scheduler.development.js:533:21)\r\n```","author":{"url":"https://github.com/dmarkow","@type":"Person","name":"dmarkow"},"datePublished":"2022-07-28T16:42:12Z","url":"https://github.com/getsentry/sentry-javascript/issues/5490"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7aa29469-2393-10bb-a9c7-da43d54917d1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C6DE:8EB91:59C633:7B566C:6B04A27E |
| html-safe-nonce | 0fee6d8835533d094777a60c3b010f011341999fcbc13dd4c2e7c0bf4d4d9e2d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNkRFOjhFQjkxOjU5QzYzMzo3QjU2NkM6NkIwNEEyN0UiLCJ2aXNpdG9yX2lkIjoiMjYxNTUwMTk3OTcyNzk5NTUxOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 1e5e7e6dd64b9bcfbc96ce49bba643508dcbe536c1b6c10226559a976b200a3f |
| hovercard-subject-tag | issue:1321209103 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/5490/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e64bf4c1f199f28adbf95b5beba4d3c5bf5cf4b272a78c4f50d0f44837b13591/getsentry/sentry-javascript/issues/5490 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e64bf4c1f199f28adbf95b5beba4d3c5bf5cf4b272a78c4f50d0f44837b13591/getsentry/sentry-javascript/issues/5490 |
| og:image:alt | Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dmarkow |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9784b6f42e2d5eac4e394fa88cad134c0dc5b6662b4ff2787a1ed1ef5a96331d |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3fd14143b75b2af7b76bbd23b069867d091adfcc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width