Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: resolve docById undefined error #4295

Merged
merged 1 commit into from
Jan 19, 2025

Conversation

BeNikk
Copy link
Contributor

@BeNikk BeNikk commented Jan 19, 2025

Description

fixes #4292

fix: resolve docById undefined error by ensuring utils.js loads before activity.js

The error "ReferenceError: docById is not defined" was occurring in activity.js
because it was trying to use docById before utils.js was fully loaded. Fixed
this race condition by explicitly ordering module dependencies in RequireJS
to ensure utils.js loads before activity.js.

  • Modified loader.js to load utils/utils before activity/activity
  • Maintains existing folder structure and RequireJS paths configuration
  • No changes to function definitions required

@FirePheonix
Copy link
Contributor

yep. this is correct.

@walterbender
Copy link
Member

This does resolve the issue. But note that the onResize method is getting called before the stage is set up, so we probably want to test that this.stage !== undefined. We can do that in a separate PR

@walterbender walterbender merged commit d08f4b9 into sugarlabs:master Jan 19, 2025
4 checks passed
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.

ReferenceError: docById is not defined in activity.js during initialization
3 participants