T
TanStack•2w ago
yappiest-sapphire

$_TSR is not defined

hii i'm getting the following error
Uncaught ReferenceError: $_TSR is not defined
at VM24 oYFISNAU:61:81
Uncaught ReferenceError: $_TSR is not defined
at VM24 oYFISNAU:61:81
it seems that the scroll restoration script is inserted before $_TSR is defined
<div style="padding-top:var(--navbarHeight);width:100%;height:100%;box-sizing:border-box">
<!--$-->
<!--$-->
<!--/$-->
<script></script>
<script class="$tsr">
(function restoreScroll({storageKey: storageKey2, key, behavior, shouldScrollRestoration, scrollToTopSelectors, location}) {
.....
)({
"storageKey": "tsr-scroll-restoration-v1_3",
"shouldScrollRestoration": true
});
$_TSR.c()
</script>
<!--/$-->
</div>
<div class="fixed inset-0 z-[45] flex items-center justify-center transition-all bg-black opacity-0 pointer-events-none" style="transition-duration:200ms"></div>
<div class="E-GYqq_notificationContainer"></div>
<script type="module" async="">
import('/assets/main-CKA35mNH.js')
</script>
<script class='$tsr'>
(self.$R = self.$R || {})["tsr"] = [];
self.$_TSR = {
c() {
document.querySelectorAll(".\\$tsr").forEach(e => {
e.remove()
}
)
},
p(e) {
this.initialized ? e() : this.buffer.push(e)
},
buffer: []
};
;$_TSR.router = ($R => $R[0] = {
<div style="padding-top:var(--navbarHeight);width:100%;height:100%;box-sizing:border-box">
<!--$-->
<!--$-->
<!--/$-->
<script></script>
<script class="$tsr">
(function restoreScroll({storageKey: storageKey2, key, behavior, shouldScrollRestoration, scrollToTopSelectors, location}) {
.....
)({
"storageKey": "tsr-scroll-restoration-v1_3",
"shouldScrollRestoration": true
});
$_TSR.c()
</script>
<!--/$-->
</div>
<div class="fixed inset-0 z-[45] flex items-center justify-center transition-all bg-black opacity-0 pointer-events-none" style="transition-duration:200ms"></div>
<div class="E-GYqq_notificationContainer"></div>
<script type="module" async="">
import('/assets/main-CKA35mNH.js')
</script>
<script class='$tsr'>
(self.$R = self.$R || {})["tsr"] = [];
self.$_TSR = {
c() {
document.querySelectorAll(".\\$tsr").forEach(e => {
e.remove()
}
)
},
p(e) {
this.initialized ? e() : this.buffer.push(e)
},
buffer: []
};
;$_TSR.router = ($R => $R[0] = {
but i checked the docs and everything seems to be fine in my __root, so i don't understand what the cause of this issue 😭 😭 is there some obvious mistake that i'm missing?
"react": "^19.1.0",
"@tanstack/react-router": "^1.135.2",
"@tanstack/react-start": "^1.135.2",
"react": "^19.1.0",
"@tanstack/react-router": "^1.135.2",
"@tanstack/react-start": "^1.135.2",
No description
1 Reply
funny-blue
funny-blue•2w ago
this should just work. can you please create a full reproducer project and share a git repo? i also fixed something w.r.t script streaming, can you please try with the latest version https://github.com/TanStack/router/releases/tag/v1.136.4

Did you find this page helpful?