Skip to content

Conversation

@sfc-gh-tteixeira
Copy link
Contributor

@sfc-gh-tteixeira sfc-gh-tteixeira commented Nov 26, 2025

📚 Context

We're not getting any stats from docs.streamlit.io. After lots of investigation, I noticed an error in the JS console, which somehow we'd missed before:

Uncaught SyntaxError: Unexpected token '&' (at (index):5:27)

And the offending line looked like this:

            function getCookie(name) {
              var value = "; " + document.cookie;   // 👈 The problem!
              var parts = value.split("; " + name + "=");  // 👈 Here too, BTW
              if (parts.length == 2) {
                return true;
              }
            }

🧠 Description of Changes

Change the way we're loading the offending script from using an inline JSX string literal to loading it from a separate file.

💥 Impact

Size:

  • Small
  • Not small

Contribution License Agreement

By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.

@sfc-gh-tteixeira sfc-gh-tteixeira merged commit b6c1764 into main Nov 26, 2025
4 checks passed
@sfc-gh-tteixeira sfc-gh-tteixeira deleted the onetrust-fix branch November 26, 2025 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants