[Electron platform] Assets FILE_NOT_FOUND error in ionic capacitor app
See original GitHub issueAsset files can’t be loaded properly in electron apps due to base href issues, even when the base href in angular has already been manually set to “./”.
Demo
The display of a standard ionic template project “tabs”:
The logo is broken due to this issue. The electron app can’t load assets/shapes.svg
The electron capacitor app is generated by:
npx cap add electron
ng build --base-href ./
npx cap copy
Capacitor version: 1.0.0-beta19 @ionic/angular version: 4.1.0
Related Issues
#888 #639 #693 This issues specifically focus on the assets side of the problem, which can’t be solved by angular cli command.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
ERR_FILE_NOT_FOUND ionic start myApp tabs --capacitor
I am brand new to ionic and I just tried to create a new ionic app with electron support by running 'ionic start...
Read more >Can't find path to file in assets folder in Capacitor app
I can play sounds from the web via urls, but not from the app's own fixed assets directory, it just says file not...
Read more >Coding Environment Software Technology Assessment
An installable application that can be run without an internet connection; Distributable via the platform 'store'; Integration with platform ...
Read more >Troubleshooting Android Issues | Capacitor Documentation
This error occurs when some Cordova or Capacitor plugin has old android support dependencies instead of using the new AndroidX equivalent. You should...
Read more >cordova-plugin-file
These platforms do not support FileReader. ... applicationDirectory - Read-only directory where the application is ... List of Error Codes and Meanings.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
There is a workaround for this issue, by refering to “assets/shapes.svg” instead of “/assets/shapes.svg” in Angular modules.
However, it is really error-prone, and somewhat embarrassing to occur in the ionic template project.
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.