This is an automated email from the ASF dual-hosted git repository.
yasithdev pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airavata-portals.git
The following commit(s) were added to refs/heads/main by this push:
new cd63ce087 fix(portal): load COMMON Vite ESM bundles as ES modules in
base.html (#148)
cd63ce087 is described below
commit cd63ce08756633cbac9f05ab282b0a681f62ad16
Author: Yasith Jayawardana <[email protected]>
AuthorDate: Mon Jun 8 13:34:56 2026 -0400
fix(portal): load COMMON Vite ESM bundles as ES modules in base.html (#148)
The common UI package migrated to Vite in #144, which emits ES module
bundles (entries statically import a shared chunk). The root base.html
still loaded them as classic scripts and referenced the Vue-CLI
'chunk-vendors' split bundle, which no longer exists under Vite — so
render_bundle raised WebpackBundleLookupError on every page.
Load the COMMON app/notices bundles via get_files + <script type="module">
so their shared-chunk imports resolve, and drop the dead chunk-vendors
references. The inline session-data script is a classic script and still
runs before the deferred module bundles.
---
.../django_airavata/templates/base.html | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/airavata-django-portal/django_airavata/templates/base.html
b/airavata-django-portal/django_airavata/templates/base.html
index 2c65ff09a..4db2aa7a2 100644
--- a/airavata-django-portal/django_airavata/templates/base.html
+++ b/airavata-django-portal/django_airavata/templates/base.html
@@ -1,5 +1,5 @@
{% load portal_chrome static %}
-{% load render_bundle from webpack_loader %}
+{% load render_bundle get_files from webpack_loader %}
{% load humanize %}
<!DOCTYPE html>
@@ -7,7 +7,6 @@
{% portal_favicon %}
{% include "./django_airavata/google_analytics.html" %}
- {% render_bundle 'chunk-vendors' 'css' 'COMMON' %}
{% render_bundle 'app' 'css' 'COMMON' %}
{% block css %}
@@ -256,10 +255,16 @@
// provide data for initializing api's session.Session
window.AiravataPortalSessionData = {{ user_session_data|safe }};
</script>
- {% render_bundle 'chunk-vendors' 'js' 'COMMON' %}
- {% render_bundle 'app' 'js' 'COMMON' %}
+ {% comment %} Vite emits ES module bundles; load them as type="module" so
their
+ shared-chunk imports resolve. The inline session script above is a classic
+ script and runs first, before these deferred modules. {% endcomment %}
+ {% get_files 'app' 'js' 'COMMON' as common_app_js %}
+ {% for f in common_app_js %}<script type="module" src="{{ f.url }}"></script>
+ {% endfor %}
{% if user.is_authenticated %}
- {% render_bundle 'notices' 'js' 'COMMON' %}
+ {% get_files 'notices' 'js' 'COMMON' as common_notices_js %}
+ {% for f in common_notices_js %}<script type="module" src="{{ f.url
}}"></script>
+ {% endfor %}
{% endif %}
{% block scripts %}
{% endblock %}