-
-
Notifications
You must be signed in to change notification settings - Fork 115
Description
Current Behavior
After building the one web app client and serving it as static files, the web application functions, but the web console shows errors for every route or module preloading. The errors are as follows:
GET https://myapp.dev/assets/_88132734_vxrn_loader.js net::ERR_ABORTED 404 (Not Found)
Uncaught (in promise) TypeError: Failed to fetch dynamically imported module: https://myapp.dev/assets/_88132734_vxrn_loader.js
Upon debugging, I discovered that this issue is caused by a naming mismatch. The actual files generated by the build process end with _preload.js, but the application attempts to fetch files with the suffix _vxrn_loader.js.
This mismatch occurs in the constants defined in the core code:
// this two should match
export const LOADER_JS_POSTFIX_UNCACHED = `_vxrn_loader.js`
export const PRELOAD_JS_POSTFIX = `_${CACHE_KEY}_preload.js`As a result, the application fails to load the required modules, leading to runtime errors.
Expected Behavior
The suffixes used for dynamically imported module files should match. Specifically, the LOADER_JS_POSTFIX_UNCACHED constant should align with the PRELOAD_JS_POSTFIX constant so that the application correctly fetches the preloaded modules without causing 404 errors.
For example, if the build process generates files with the suffix _preload.js, the application should attempt to fetch files with the same suffix, ensuring seamless module loading.
One Version
1.1.451Platform (Web, iOS, Android)
WebReproduction
- Create a new web application with multiple routes
- Build a simple UI that uses `<Link href="..." />` between the routes
- Run `one build` to get a production ui
- Serve the static files from a web server
- When using the application links, the console will show the errors