From 23ccd482605791d7b30ecc9ebcf8dc33806bf525 Mon Sep 17 00:00:00 2001 From: Deimer M Date: Wed, 7 Jan 2026 10:16:55 -0500 Subject: [PATCH] Revert "fix: intermittent "utils attribute not found" issue in webpack_loader (#37306)" This reverts commit 2ec6f1ea45440eef6b8921afa04da58801da13b2. --- xmodule/util/builtin_assets.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/xmodule/util/builtin_assets.py b/xmodule/util/builtin_assets.py index 6b8eb86ecf34..cb1fca721414 100644 --- a/xmodule/util/builtin_assets.py +++ b/xmodule/util/builtin_assets.py @@ -5,6 +5,7 @@ """ from pathlib import Path +import webpack_loader from django.conf import settings from django.core.exceptions import ImproperlyConfigured @@ -43,11 +44,6 @@ def add_webpack_js_to_fragment(fragment, bundle_name): """ Add all JS webpack chunks to the supplied fragment. """ - # Importing webpack_loader.utils at the top of the module causes an exception: - # OSError: Error reading webpack-stats.json. - # Are you sure webpack has generated the file and the path is correct? - # We are not quite sure why. - from webpack_loader.utils import get_files - for chunk in get_files(bundle_name, None, 'DEFAULT'): + for chunk in webpack_loader.utils.get_files(bundle_name, None, 'DEFAULT'): if chunk['name'].endswith(('.js', '.js.gz')): fragment.add_javascript_url(chunk['url'])