cordova-electron icon indicating copy to clipboard operation
cordova-electron copied to clipboard

File not found

Open praveenptl71 opened this issue 5 years ago • 5 comments

Bug Report

Problem

Js files not found in electron build

What is expected to happen?

Successfully load js on Linux deb package

What does actually happen?

Fail to load build js files

Information

runtime-es2015.js:1 Failed to load resource: net::ERR_FILE_NOT_FOUND polyfills-es2015.js:1 Failed to load resource: net::ERR_FILE_NOT_FOUND styles-es2015.js:1 Failed to load resource: net::ERR_FILE_NOT_FOUND cordova.js:1 Failed to load resource: net::ERR_FILE_NOT_FOUND vendor-es2015.js:1 Failed to load resource: net::ERR_FILE_NOT_FOUND main-es2015.js:1 Failed to load resource: net::ERR_FILE_NOT_FOUND

Command or Code

Environment, Platform, Device

Ionic cordova Electron Ubuntu 16

Version information

Checklist

  • [ ] I searched for existing GitHub issues
  • [ ] I updated all Cordova tooling to most recent version
  • [ ] I included all the necessary information above

praveenptl71 avatar Oct 01 '19 05:10 praveenptl71

Is this reproducible in a new, plain Cordova app? A minimal reproduction repository would really help to debug and later fix this issue. More information on how to create one: https://github.com/apache/cordova-contribute/blob/master/create-reproduction.md

timbru31 avatar Oct 01 '19 13:10 timbru31

If you are using a leading slash in your file path, for example /runtime-es2015.js or if you have set the base tag href to /, this may be causing you the issue your seeing.

A file path in Electron, for example, would look something like this file://some/file/path/www/....

Using a leading / or setting the base tag to / for example will try and fetch the file from file:// which is incorrect.

erisu avatar Oct 01 '19 13:10 erisu

I've not add any / base tag and href manually, i have created build using command and got this error.

praveenptl71 avatar Oct 02 '19 05:10 praveenptl71

I have experienced the same issue using ionic and cordova electron

First I have to change line in index.html

<base href="/" /> to <base href="./" />

But it hasn't fixed all the issues with es2015 like files- then I have to change in tsconfig.json

from

"target": "es2015",

to

"target": "es5",

mzielezny avatar Oct 18 '19 14:10 mzielezny

According with zimprince (commented on Jul 11, 2019) in https://github.com/ionic-team/starters/issues/451:

1 ionic cordova platform remove android
2 ionic cordova platform add [email protected]
3 ionic cordova plugin remove cordova-plugin-ionic-webview
4 ionic cordova plugin add cordova-plugin-ionic-webview@latest (I were using 1.2.0, after remove and add again, it's in 5.0.0)

This solved to me! :D

Pedrohf360 avatar Nov 11 '20 13:11 Pedrohf360