Skip to content

Video Block JS not available statically on sandbox/prod environment #479

Closed

Description

@farhan

As we have extracted the BuiltIn Blocks to xblocks-contrib we have started using local_resource_url method of runtime to load the static file that suppose to be bundled by the runtime and make it statically available.

It's working fine on local machine setup (tutor dev) but not working on the sandbox created in the PR's (Video, Problem)

Sanbox environment has been created in the following PR to test the Extracted Video Block (to xblocks-contrib)
openedx/openedx-platform#37851

Test results:

  1. Extracted Video Block is working fine (with static JS file) on local machine setup (tested on tutor dev).
  2. Video Block JS not available statically on sandbox/prod environment in referenced PR.

In this story we will figure the root cause and fix the issue. It seems JS file is not bundled.

Video Block JS file is available in the sandbox for the Built In Video Block

Image

Video Block JS file is available in the local machine (tutor dev) setup for the Extracted Video Block

Image

Video Block JS file is not available in the sandbox for the Extracted Video Block

Image

Activity

  1. moved this to 📋 Backlog in Aximprovements Teamon Jan 12, 2026
  2. moved this from 📋 Backlog to 🔖 Ready in Aximprovements Teamon Jan 20, 2026
  3. farhan commented on Jan 20, 2026

    @farhan
    Author

    I have done its testing and verified JS file is bundling in the python package using following commands.
    So we need to verify it what's the issue in the edx-platform webpack bundling for the sandbox/prod environment.

    # Build the package
    python -m build
    
    # Install from the build distribution
    pip install dist/your_package-0.1.0-py3-none-any.whl
    
    # Or install in editable mode for development
    pip install -e .
    
    # For source distributions
    tar -tzf dist/your_package-0.1.0.tar.gz
  4. moved this from 🔖 Ready to 🏗 In progress in Aximprovements Teamon Jan 22, 2026
  5. self-assigned this
    on Jan 22, 2026
  6. moved this from 🏗 In progress to 🔖 Ready in Aximprovements Teamon Jan 22, 2026
  7. moved this from 🔖 Ready to 🏗 In progress in Aximprovements Teamon Feb 2, 2026
  8. farhan commented on Feb 3, 2026

    @farhan
    Author

    I have done the testing for this issue on local machine sandbox (tutor dev env) and its working for both boolean values of following pipeline.

    GROVE_COMMON_SETTINGS: |
      PIPELINE['PIPELINE_ENABLED'] = True
      STATICFILES_FINDERS = [
          'openedx.core.djangoapps.theming.finders.ThemeFilesFinder',
          'django.contrib.staticfiles.finders.FileSystemFinder',
          'django.contrib.staticfiles.finders.AppDirectoriesFinder',
          'openedx.core.lib.xblock_pipeline.finder.XBlockPipelineFinder',
          'pipeline.finders.PipelineFinder'
      ]
    

    I have tried to update the pipeline settings on the following PR sandbox, but sandbox maintenance is on the way
    openedx/openedx-platform#37851

  9. moved this from 🏗 In progress to 🛑 Blocked in Aximprovements Teamon Feb 3, 2026
  10. moved this from 🛑 Blocked to 🏗 In progress in Aximprovements Teamon Feb 3, 2026
  11. farhan commented on Feb 6, 2026

    @farhan
    Author

    I have verified js file is collected statically and available via url:
    https://studio.pr-37851-1a7bbe.axim-sandboxes.opencraft.hosting/xblock/resource/video/public/js/video-xblock.js

    Next: Why its unable to load via local_resource_url

  12. self-assigned this
    on Feb 9, 2026
  13. farhan commented on Feb 10, 2026

    @farhan
    Author

    Issue is hoping to be fixed in this commit.

    Testing on the sandbox is pending.

    cc: @irtazaakram

  14. farhan commented on Feb 11, 2026

    @farhan
    Author
  15. moved this from 🏗 In progress to ✅ Done in Aximprovements Teamon Feb 11, 2026
  16. kdmccormick commented on Feb 11, 2026

    @kdmccormick
    Member

    Great!

  17. farhan commented on Feb 12, 2026

    @farhan
    Author

    @kdmccormick
    Adding for the reference how we resolved it:

    @staticmethod
        def _video_js_resource_path():
            """
            Returns the URL for the local resource.
    
            Note: when running with the full Django pipeline, the file will be accessed
            as a static asset which will use a CDN in production.
    
            For more details, see platform's xblock_local_resource_url() define in:
            https://github.com/openedx/openedx-platform/blob/master/openedx/core/lib/xblock_utils/__init__.py
            """
            if settings.PIPELINE.get('PIPELINE_ENABLED', False) or not getattr(settings, 'REQUIRE_DEBUG', False):
                return "video/public/js/video-xblock.js"
            else:
                return "public/js/video-xblock.js"

    copied from here

    We should add the findings somewhere around following code references for the guidelines how to use the method.

    xblock > local_resource_url
    openedx-platform > xblock_local_resource_url

    cc: @openedx/axim-aximprovements

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions