framework7io / framework7

Full featured HTML framework for building iOS & Android apps
http://framework7.io
MIT License
18.04k stars 3.23k forks source link

Problem: Vite Bundle reference component function by '$' prefixed character #4143

Closed hus201 closed 8 months ago

hus201 commented 1 year ago

Hello all, i've faced a problem where the framework7 core app bundled using vite stops rendering components when the application gets bigger with many components resulting similar errors to the following: Uncaught (in promise) Error: InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('$d') is not a valid name. after very low-level debugging inside the bundle i found that vite bundle reference the component by his way of naming enabled by minify option where some components get referenced by dollar signed prefixed characters which get conflicted by dom7 which uses $ for its needs. fixed that with disabling minify in vite.config.js config.build.minify option

export default {
    build: {
        minify: false,
       },
  ....
}
hus201 commented 1 year ago

Update : The Problem happens in local components rendering explained in full details in this fourm thread https://forum.framework7.io/t/problem-after-building-core-app-with-vite/16224