Vue component not rendering in production build

I have this Filter code in which @vueforms/multiselect component is used:

Filter.vue

<template>
<div id="testm"></div>
</template>
<script lang="ts">
import {createApp} from 'vue';
import Multiselect from '@vueform/multiselect';
export default {
  name: 'DataFilter',
  async mounted() {
   
    let parent = document.getElementById("testm") as HTMLDivElement;
    const app = createApp({
      data() {
        return {

        };
      },
      methods: {

      },
      template: `
    <Multiselect

    />`,
      components: {
        Multiselect
      }
    });

    // if (app._container) {
    //   app.unmount();
    // }
    try {
      app.mount(parent);
      alert("mounted")
    } catch (error) {
      console.error('Error mounting app:', error);
    }
  },
}
</script>

Everything works with npm run dev while doing development.

But when I create a build using npm run build and deploy the dist folder. The component is not rendering at all like it’s not even there. The alerts and everything works fine.

The above is just a sample preview (skeleton) to explain of the Filter.vue some syntax errors might be there. Please ignore them.

If I add the component itself in the <template> like:

<template>
<Multiselect />
</template>

Then the component is rendered properly after build. I have spent many days on this issue, but not able to find solution (which works for me) regarding it.

Can you please tell what am I missing or how to fix this?

There are no console errors thrown, everything runs fine but with missing multiselect like it’s not there at all.


Concept of Filter:

Consider these specifically designed strings (each acts as a filter):

{column = 'abc'} // simple one
{{column = 'abc'}or{column2 does not contains 'xyz'}} // with and/or condition
{{{column = 'abc'}and{column2 contains 'xyz'}}or{table1col3->table2col1->table3col7 = 'def'}} // with and/or + reference
  • A filter node contains min 3 multiselects (column, operator, value)
  • Filter node can contain references as well like: table1col3->table2col1->table3col7 (each reference is a multi-select)
  • Every filter node is connected with other using AND/OR conditions with right wrapping inside container for processing with {...}
  • Unlimited number of filter nodes added with and/or with unlimited depth
  • Unlimited number of reference columns can be present (Everything is repetable basically)
  • All the filter suggestions are loaded using async call to backend with searchText that is either typed or selected from dropdown

I’m using div with specific classes like filterContainer and or filterNode ...etc

In the end, once the user creates a filter, I navigate the HTML with right classes and generates the above mentioned filter string and sends to backend for filteration.

Please suggestion what can be improved. The filterNodes are created by javascript functions (not on mounted method) which are triggered on button clicks (which adds filter node at the right location.)

9

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