fix(build): resolve web app loading failure by simplifying Vite configuration

- Simplify vite.config.web.mts to match working capacitor configuration
- Remove complex mergeConfig() approach that was causing Vue compilation errors
- Eliminate environment-specific build configurations that weren't needed
- Fix "TypeError: Cannot read properties of undefined (reading 'on')" at App.vue:1

Problem: The web build was failing during Vue component compilation with a cryptic
error at line 1 of App.vue. Investigation revealed the issue was in the overly
complex Vite configuration that used mergeConfig() with environment-specific
settings, while the working capacitor build used the simple direct approach.

Solution: Simplified web config to use createBuildConfig('web') directly, matching
the proven capacitor pattern. This eliminates the Vue compilation failure while
preserving all functionality including deep links.

Root cause: Complex build configuration was interfering with Vue's component
processing, causing the .on() error during initial component registration.

Files changed:
- vite.config.web.mts: Simplified to match capacitor configuration pattern
- vite.config.common.mts: Temporarily disabled ESBuild error handling (not root cause)

Testing: Web app now loads successfully, Vue compilation completes, deep links
preserved, and build architecture maintained.
This commit is contained in:
Matthew Raymer
2025-08-20 09:18:09 +00:00
parent 612c0b51cc
commit 9de6ebbf69
4 changed files with 1196 additions and 1167 deletions

View File

@@ -202,9 +202,9 @@
"three": "^0.156.1",
"ua-parser-js": "^1.0.37",
"uint8arrays": "^5.0.0",
"vue": "^3.5.13",
"vue": "3.5.13",
"vue-axios": "^3.5.2",
"vue-facing-decorator": "^3.0.4",
"vue-facing-decorator": "3.0.4",
"vue-picture-cropper": "^0.7.0",
"vue-qrcode-reader": "^5.5.3",
"vue-router": "^4.5.0",