Skip to content

Minified React error on production when there is an external async script in the head of __root.tsx #6568

@kcoet

Description

@kcoet

Which project does this relate to?

Start

Describe the bug

If we insert an object like below into the scripts in the head of the __root.tsx file it will cause a Minified React error error.

scripts: [
  {
    async: true,
    src: `https://www.googletagmanager.com/gtag/js?id=G-XXXXXX`,
  },
]

Error:

Image

Your Example Website or App

https://stackblitz.com/edit/github-zpekad3w?file=src%2Froutes%2F__root.tsx

Steps to Reproduce the Bug or Issue

  1. run npm run build
  2. start production server npm run start
  3. open production URL
  4. check browser console

Expected behavior

Should not display errors

Screenshots or Videos

No response

Platform

  • Router / Start Version: 1.157.18
  • OS: Linux
  • Browser: Chrome
  • Browser Version: 144.0.7559.110
  • Bundler: vite
  • Bundler Version: 7.3.1

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions