Skip to content

fix(create-docusaurus): update @types/gtag.js to 0.0.20#11770

Merged
slorber merged 2 commits intofacebook:mainfrom
fresh3nough:fix/update-gtag-types
Mar 5, 2026
Merged

fix(create-docusaurus): update @types/gtag.js to 0.0.20#11770
slorber merged 2 commits intofacebook:mainfrom
fresh3nough:fix/update-gtag-types

Conversation

@fresh3nough
Copy link
Contributor

@fresh3nough fresh3nough commented Mar 3, 2026

Bumps @types/gtag.js from 0.0.12 to 0.0.20 (latest) in the TypeScript template + yarn.lock.

Fixes #11615

Steps to Reproduce the Issue (AI-assisted)

  1. Visit https://docusaurus.io/docs/playground
  2. Click either StackBlitz button (JavaScript or TypeScript)
  3. StackBlitz automatically runs yarn install && npm start
  4. yarn install fails with: "EIO: @types/gtag.js@0.0.12 not found in cache, try running install again"

The root cause is that @types/gtag.js@0.0.12 targets TypeScript 4.1/4.2 and is no longer available in the StackBlitz cache. Updating to 0.0.20 (the version recommended for modern TypeScript) resolves this.

How to Verify the Fix

  1. After merging, open the StackBlitz TypeScript example: https://stackblitz.com/github/facebook/docusaurus/tree/main/examples/classic-typescript
  2. Confirm yarn install && npm start completes successfully without the @types/gtag.js cache error
  3. Alternatively, test against this branch directly: https://stackblitz.com/github/fresh3nough/docusaurus/tree/fix/update-gtag-types/examples/classic-typescript

Test Plan

  • npx create-docusaurus my-site classic --typescript
  • cd my-site && yarn install (succeeds)
  • yarn start works

Update @types/gtag.js from ^0.0.12 to ^0.0.20 in the google-gtag plugin
and add yarn resolutions in example templates to fix StackBlitz install
failures caused by the outdated @types/gtag.js@0.0.12 not being available
in StackBlitz's package cache.

Fixes facebook#11615
@meta-cla meta-cla bot added the CLA Signed Signed Facebook CLA label Mar 3, 2026
@socket-security
Copy link

socket-security bot commented Mar 3, 2026

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report

@netlify
Copy link

netlify bot commented Mar 3, 2026

[V2]

Built without sensitive environment variables

Name Link
🔨 Latest commit 5f6fde7
🔍 Latest deploy log https://app.netlify.com/projects/docusaurus-2/deploys/69a9952a0e254400088593b9
😎 Deploy Preview https://deploy-preview-11770--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Collaborator

@slorber slorber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

Glad to hear it fixes the Stackblitz issue. Curious though, how can I verify this?

Can you please revert the changes to the examples?

@fresh3nough
Copy link
Contributor Author

steps to reproduce added as requested @slorber

@slorber slorber added the pr: bug fix This PR fixes a bug in a past release. label Mar 5, 2026
@slorber
Copy link
Collaborator

slorber commented Mar 5, 2026

Thanks

@slorber slorber merged commit 63ccba8 into facebook:main Mar 5, 2026
43 of 44 checks passed
@fresh3nough
Copy link
Contributor Author

happy hacking

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Signed Facebook CLA pr: bug fix This PR fixes a bug in a past release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Creating a reproducer does not work on stackblitz, for both JS/TS due to bad dependency

2 participants