Issue with VR360 Library Integration in Production Build

I am experiencing a problem that occurs only when compiling the project for production using the command

clean package -Pproduction.

Here are the details:

Development Environment: I am using Spring Tool Suite 4, version 4.21.1.
Project Configuration: The project uses Java 21 and Vaadin version 24.4.7.

I added the npm library ‘aframe’ using the annotation

@NpmPackage(value = “aframe”, version = “1.6.0”) 

and imported it into a Lit component.
This works fine in development.

However, I encounter an issue during the production build. When accessing the application (both on Chrome and Firefox), the app remains stuck in the loading state without ever completing, and the console does not show any errors.

The same issue occurs if I remove the @NpmPackage annotation and instead import the library directly in the index.html file using:

<script src="https://aframe.io/releases/1.6.0/aframe.min.js"></script>

Strangely, the same error occurs with the following libraries (used one at a time without aframe):

  • three
  • @photo-sphere-viewer/core
  • panolens

Could you please provide guidance on how to resolve this issue?


While trying to reproduce an example error, we found that it was an issue on our end.

In earlier versions of Vaadin lit decorators are located in ‘lit-element’ however, in more recent versions, these decorators have been moved to ‘lit/decorators.js’.
To improve the porting of components that import lit decorators, and are used in projects with differents versions, we implemented a dynamic import:

   async function dinamicImports() {
        console.log("**** dinamicImports ");
    
        let version =  (window as any).MPVaadinVersion;
    
        const litElementImport = await import('lit-element');
        console.log("****dinamicImports litElementImport ", litElementImport);
    
        const { LitElement, css, html } = litElementImport;
        // This is printed
        console.log("****dinamicImports { LitElement, css, html } ");
    
        var decoratorsModule : any = litElementImport;
        if ( version == "someVersion" ) {
            decoratorsModule = await import('lit/decorators.js');
            // This is NOT printed
            console.log("****dinamicImports decoratorsModule ");
        }
    
        const { customElement, property, query } = decoratorsModule;
    
        console.log("****dinamicImports return ");
        return { customElement, property, query, LitElement, css, html };
    } 
    
    export const { customElement, property, query, LitElement, css, html } = await dinamicImports();

After that, in the various components, we were importing them with the following code:

import { LitElement, css, customElement, html, property, query } from '../VaadinLitAdapter';

This works perfectly in development, but the reported issue occurs when the project is compiled for production. It fails to resolve the import correctly and remains stuck in a pending state.

Any ideas about this?

5

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật