René's URL Explorer Experiment


Title: data-tsd-source inject-source plugin causes hydration mismatch in SSR (TanStack Start) · Issue #405 · TanStack/devtools · GitHub

Open Graph Title: data-tsd-source inject-source plugin causes hydration mismatch in SSR (TanStack Start) · Issue #405 · TanStack/devtools

X Title: data-tsd-source inject-source plugin causes hydration mismatch in SSR (TanStack Start) · Issue #405 · TanStack/devtools

Description: Description The inject-source plugin in @tanstack/devtools-vite causes React hydration mismatch warnings in TanStack Start (SSR) projects. The data-tsd-source attributes are injected with different line numbers on the server vs client tr...

Open Graph Description: Description The inject-source plugin in @tanstack/devtools-vite causes React hydration mismatch warnings in TanStack Start (SSR) projects. The data-tsd-source attributes are injected with different...

X Description: Description The inject-source plugin in @tanstack/devtools-vite causes React hydration mismatch warnings in TanStack Start (SSR) projects. The data-tsd-source attributes are injected with different...

Opengraph URL: https://github.com/TanStack/devtools/issues/405

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"data-tsd-source inject-source plugin causes hydration mismatch in SSR (TanStack Start)","articleBody":"## Description\n\nThe `inject-source` plugin in `@tanstack/devtools-vite` causes React hydration mismatch warnings in TanStack Start (SSR) projects. The `data-tsd-source` attributes are injected with different line numbers on the server vs client transform passes, because other Vite plugins (e.g. `tanstackStart()`, `viteReact()`) shift line numbers differently between SSR and client bundles.\n\n## Reproduction\n\n1. Create a TanStack Start project with `@tanstack/devtools-vite` v0.6.0\n2. Add `devtools()` to `vite.config.ts`\n3. Navigate to any SSR-rendered route\n4. Observe console warning:\n\n```\nA tree hydrated but some attributes of the server rendered HTML didn't match the client properties.\n\n\u003cdiv\n+ data-tsd-source=\"/src/routes/simulations/$slug/editor.tsx:632:5\"\n- data-tsd-source=\"/src/routes/simulations/$slug/editor.tsx:636:5\"\n>\n```\n\nLine numbers are consistently off by a fixed offset (4 lines in my case) — the server and client transforms produce different source locations for the same JSX elements.\n\n## Root Cause\n\nIn `plugin.ts`, the `inject-source` Vite plugin's `apply` function only checks `config.mode === 'development'`:\n\n```typescript\napply(config) {\n  return config.mode === 'development' && injectSourceConfig.enabled\n},\n```\n\nThe `transform` hook does not check the `ssr` boolean that Vite passes as the third argument. Since `data-tsd-source` is only useful on the client (for click-to-source in the devtools UI), injecting it during the SSR pass creates the mismatch.\n\n## Suggested Fix\n\nSkip source injection during the SSR transform pass. The Vite `transform` hook receives `{ ssr: boolean }` as the third argument:\n\n```typescript\ntransform(code, id, options) {\n  if (options?.ssr) return; // Only inject on client\n  // ... existing Babel transform\n}\n```\n\nThis would eliminate the hydration mismatch while preserving click-to-source functionality on the client.\n\n## Workaround\n\nDisable source injection entirely:\n\n```typescript\ndevtools({ injectSource: { enabled: false } })\n```\n\nThis removes the hydration warning but loses click-to-source in the devtools UI.\n\n## Environment\n\n- `@tanstack/devtools-vite`: 0.6.0\n- `@tanstack/react-start`: latest\n- React 19\n- Vite 7","author":{"url":"https://github.com/twentynineteen","@type":"Person","name":"twentynineteen"},"datePublished":"2026-03-26T09:58:22Z","url":"https://github.com/TanStack/devtools/issues/405"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:5dd89502-6e69-f495-ccef-0d868daf3ad9
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE5FE:3166AC:27F028A:347E9AC:6AF9AA84
html-safe-nonce2d4326ac0b3a634eb43e98133dcabe582284eeb0e4bb7966288071b8ab1910f8
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNUZFOjMxNjZBQzoyN0YwMjhBOjM0N0U5QUM6NkFGOUFBODQiLCJ2aXNpdG9yX2lkIjoiNjA5Mjk4NTYxMDI5MTIyNzI2OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac46cb09cc7303b14aa9a1e550256f05ffb267ec9960de94b8b5209f26e99ed35a
hovercard-subject-tagissue:4142369440
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/TanStack/devtools/405/issue_layout
twitter:imagehttps://opengraph.githubassets.com/50a43d5767686ad0d108ce8c095559f701d79f6c7105e00d9abdb37e00667aaa/TanStack/devtools/issues/405
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/50a43d5767686ad0d108ce8c095559f701d79f6c7105e00d9abdb37e00667aaa/TanStack/devtools/issues/405
og:image:altDescription The inject-source plugin in @tanstack/devtools-vite causes React hydration mismatch warnings in TanStack Start (SSR) projects. The data-tsd-source attributes are injected with different...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernametwentynineteen
hostnamegithub.com
expected-hostnamegithub.com
None612d3e6ffd693e7ea8d9fcf452370995872baef31d825b1fedef704cd3d24ac7
turbo-cache-controlno-preview
go-importgithub.com/TanStack/devtools git https://github.com/TanStack/devtools.git
octolytics-dimension-user_id72518640
octolytics-dimension-user_loginTanStack
octolytics-dimension-repository_id1026402761
octolytics-dimension-repository_nwoTanStack/devtools
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1026402761
octolytics-dimension-repository_network_root_nwoTanStack/devtools
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release072e34035c13c31543fba9f025cbbbda4210dae4
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/TanStack/devtools/issues/405#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FTanStack%2Fdevtools%2Fissues%2F405
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FTanStack%2Fdevtools%2Fissues%2F405
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=TanStack%2Fdevtools
Reloadhttps://github.com/TanStack/devtools/issues/405
Reloadhttps://github.com/TanStack/devtools/issues/405
Reloadhttps://github.com/TanStack/devtools/issues/405
TanStackhttps://github.com/TanStack
devtoolshttps://github.com/TanStack/devtools
Codehttps://github.com/TanStack/devtools
Issues24 (24)https://github.com/TanStack/devtools/issues
Pull requests25 (25)https://github.com/TanStack/devtools/pulls
Discussionshttps://github.com/TanStack/devtools/discussions
Actionshttps://github.com/TanStack/devtools/actions
Security and qualityhttps://github.com/TanStack/devtools/security
Insightshttps://github.com/TanStack/devtools/pulse
https://github.com/TanStack/devtools
New issuehttps://github.com/login?return_to=https://github.com/TanStack/devtools/issues/405
New issuehttps://github.com/login?return_to=https://github.com/TanStack/devtools/issues/405
#548https://github.com/TanStack/devtools/pull/548
data-tsd-source inject-source plugin causes hydration mismatch in SSR (TanStack Start)https://github.com/TanStack/devtools/issues/405#top
#548https://github.com/TanStack/devtools/pull/548
https://github.com/twentynineteen
twentynineteenhttps://github.com/twentynineteen
on Mar 26, 2026https://github.com/TanStack/devtools/issues/405#issue-4142369440
AlemTuzlakhttps://github.com/AlemTuzlak
completedhttps://github.com/TanStack/devtools/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#548https://github.com/TanStack/devtools/pull/548
on Oct 29, 2026https://github.com/TanStack/devtools/issues/405#event-34601371518
thedv91https://github.com/thedv91
on Oct 29, 2026https://github.com/TanStack/devtools/issues/405#event-34612612990
fix(devtools-vite): inject data-tsd-source before other plugins trans…https://github.com/thedv91/devtools/commit/40f32e4cda7bc4858f8a1fced7fef77fe87ea50b
https://docs.github.com/articles/closing-issues-via-commit-messages
40f32e4https://github.com/thedv91/devtools/commit/40f32e4cda7bc4858f8a1fced7fef77fe87ea50b
Sign up for freehttps://github.com/signup?return_to=https://github.com/TanStack/devtools/issues/405
Sign in to commenthttps://github.com/login?return_to=https://github.com/TanStack/devtools/issues/405
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.