-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Which project does this relate to?
Start
Describe the bug
When using the Scripts
component and defining scripts
array inside createRootRoute
, the same script gets added multiple times in the head tag. This also results in double scripts for hot reload inside the body
Removing the <Scripts />
component removes the entire client side functionality
Your Example Website or App
Steps to Reproduce the Bug or Issue
- Go to the codesandbox url
- Open the devtools using the button to the right of the URL bar (in codesandbox preview)
- Open the head tag
Expected behavior
The script tag should be added only once, because it is defined only once
Screenshots or Videos



Platform
- Router / Start Version: 1.125.4
- OS: Linux (Codesandbox)
- Browser: Edge
- Browser Version: 139.0.3405.13
- Bundler: Vite
- Bundler Version: 6.3.5
Additional context
I think this may be caused due to the script being added automatically by createRootRoute
, HeadContent
and Scripts
. There must be a way to filter out duplicate scripts in order to fix this
okxiaoliang4, lancej1022, florianldt, danielr18, kaandok and 6 more
Metadata
Metadata
Assignees
Labels
No labels