Skip to content

Conversation

@amaan-bhati
Copy link
Member

@amaan-bhati amaan-bhati commented Jan 29, 2026

What has changed?

Fixed the markdow hook error that was causing build failures. Also added the apollo script.
Please include a summary of the change.

  • Removed the unsupported markdown.hooks.onBrokenMarkdownLinks block from docusaurus.config.js . Docusaurus 3 doesn’t recognize markdown.hooks, so keeping it caused Error: These field(s) ("markdown.hooks",) are not recognized in docusaurus.config.js. during config validation.
  • The build now succeeds because we only rely on supported schema fields; the invalid block would have blocked every docusaurus build/npm run build
  • Added The appolo script:
    • What this script is: The Apollo snippet asynchronously injects Apollo’s tracker.iife.js with a cache-busting query string and calls window.trackingFunctions.onLoad with the provided appId, so the third-party tracker boots without blocking the docs render.
    • Initial idea: I first tried to keep it inline in docusaurus.config.js via an object that mirrored the original <script> (IIFE + DOM operations) and even gave it an id so Docusaurus could manage it reliably.
    • Error encountered: Docusaurus rejected that approach: scripts[2] isn’t valid because the config expects either a plain string or an object with a src. Inline innerHTML objects don’t pass validation anymore.
    • Final implementation and how it works: The tracker logic now lives in apollo-init.js, which runs the same IIFE, generates the cache-buster, injects the tracker, and forwards the appId once onload fires. docusaurus.config.js just references apollo-init.js with async/defer, so the build validates, the script stays non-blocking, and the tracker still initializes exactly as before.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).
  • Documentation update (if none of the other choices apply).

How Has This Been Tested?

Please run npm run build and npm run serve to check if the changes are working as expected. Please include screenshots of the output of both the commands. Add screenshots/gif of the changes if possible.

  • Ran npm run build and nothing breaks:
Screenshot 2026-01-29 at 1 17 28 PM

Checklist:

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.

Signed-off-by: amaan-bhati <amaanbhati49@gmail.com>
Copy link
Member

@Achanandhi-M Achanandhi-M left a comment

Choose a reason for hiding this comment

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

LGTM

@Achanandhi-M Achanandhi-M requested a review from nehagup January 29, 2026 08:12
@nehagup nehagup merged commit 63fa9e4 into main Jan 29, 2026
5 of 7 checks passed
@nehagup nehagup deleted the apollo-script branch January 29, 2026 09:51
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.

4 participants