fix: make the Google Analytics loader compile in the site build - #72
Merged
arbrandes merged 2 commits intoAug 7, 2026
Merged
Conversation
The loader was copied verbatim from frontend-platform, where it only ever lived in a .js file. Inlining it into customApp.tsx put it under the frontend-base type checker, which rejected the implicit this.analyticsId property, the undeclared global, and the possibly-null parentNode. Rewrite it as plain JavaScript that also type-checks, and drop the unused Segment-style load() indirection while at it. Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Enabling
tutor-contrib-google-analyticsbroketutor images build mfe mfe-dev: the frontend-base site build failed with six TypeScript errors insrc/customApp.tsx.The plugin inlines a single
GoogleAnalyticsLoadersnippet into two pipelines.env.config.jsx(legacy MFEs) is only ever run through Babel, butcustomApp.tsx(the frontend-base site) is compiled bytscwithstrict: trueandnoImplicitAny: false. The loader had been copied verbatim from@openedx/frontend-platform, where it only ever lived in a.jsfile, so it had never had to satisfy a type checker.This rewrites the snippet as plain JavaScript that also type-checks, keeping it usable by both pipelines.
LLM usage notice
Built with assistance from Claude.