question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Electron platform] Assets FILE_NOT_FOUND error in ionic capacitor app

See original GitHub issue

Asset 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”: 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:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ZhennanWucommented, Apr 10, 2019

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.

0reactions
ionitron-bot[bot]commented, Nov 11, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found