Skip to content

Commit 37a438c

Browse files
authored
Revert "fix: intermittent "utils attribute not found" issue in webpack_loader (openedx#37306)" (#314)
This reverts commit 2ec6f1e.
1 parent 2e2704e commit 37a438c

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

xmodule/util/builtin_assets.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"""
66
from pathlib import Path
77

8+
import webpack_loader
89
from django.conf import settings
910
from django.core.exceptions import ImproperlyConfigured
1011

@@ -43,11 +44,6 @@ def add_webpack_js_to_fragment(fragment, bundle_name):
4344
"""
4445
Add all JS webpack chunks to the supplied fragment.
4546
"""
46-
# Importing webpack_loader.utils at the top of the module causes an exception:
47-
# OSError: Error reading webpack-stats.json.
48-
# Are you sure webpack has generated the file and the path is correct?
49-
# We are not quite sure why.
50-
from webpack_loader.utils import get_files
51-
for chunk in get_files(bundle_name, None, 'DEFAULT'):
47+
for chunk in webpack_loader.utils.get_files(bundle_name, None, 'DEFAULT'):
5248
if chunk['name'].endswith(('.js', '.js.gz')):
5349
fragment.add_javascript_url(chunk['url'])

0 commit comments

Comments
 (0)