I’m currently working on a React project using Vite and attempting to wrap it with Cordova for mobile deployment. Everything functions correctly on Android, but when running on iOS, I encounter a white screen and the app fails to load.
What I’ve Tried:
- Followed the standard Cordova approach: created a Cordova project, added Android and iOS platforms, moved build files to the www folder, and used cordova run .
- Tested with a Create React App (CRA) project in the same Cordova setup, which worked fine on iOS.
- Replaced the app’s build file with a basic JavaScript file, which loaded correctly.
- Modified the HTML to load this basic JavaScript file as type=”module” (as Vite sets it), which resulted in failure.
- Attempted to alter the Vite build process to generate a non-module JavaScript file, but this did not resolve the issue.
Observations:
- It seems Cordova on iOS has trouble loading files with type=”module”.
- Even after switching to a SystemJS-based build, the issue persisted.
Temporary Solution:
Successfully made it work using Capacitor instead of Cordova, but I’m interested in finding a Cordova-based solution.
Question:
Has anyone successfully integrated React, Vite, and Cordova, particularly for iOS deployment? Any insights or suggestions to resolve this module loading issue with Cordova on iOS would be greatly appreciated.
Environment:




