apache / apache/cordova-electron

Failed to load resource: net::ERR_FILE_NOT_FOUND - app.js in www folder does not exist

Open
#242 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
135
Forks
60
Avg merge
1d 6h
Merged PRs (30d)
5

Description

# Bug Report

## Problem
Builded app is trying to load resources from app.js file that does not exist. The path is:
_platforms/electron/www/app.js_

### What is expected to happen?
After running _cordova run electron --nobuild_ or _cordova run electron_ the app should work as expected.

### What does actually happen?
After running _cordova run electron --nobuild_ or _cordova run electron_ the the app has white background with the following error in the console:

Failed to load resource: net::ERR_FILE_NOT_FOUND (app.js).

## Information
I am trying to build and run cordova electron app on Windows 10 machine.
In package.json project I am using following plugins:
"@journeyapps/sqlcipher": "^5.3.1",
"cordova-electron": "^3.1.0",
"electron-rebuild": "^3.2.9"

### Command or Code
I followed these steps:
1. cordova platform rm electron
2. cordova platform add electron
3. cordova prepare
4. $(npm bin)/electron-rebuild
5. cordova run electron --nobuild or cordova run electron (without nobuild flag)

### Additional Information
Cordova Packages:
cli: 11.0.0
common: 4.0.2
create: 4.0.0
lib: 11.0.0
common: 4.0.2
fetch: 3.0.1
serve: 4.0.0

Project Installed Platforms:
electron: 3.1.0

Environment:
OS: Microsoft Windows 10 Pro x64
Node: v14.17.0
npm: 6.14.13

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with `cordova run electron --nobuild` and inspect the generated `_platforms/electron/www/app.js` path and Electron platform setup. Compare the generated resource references with the files present after `cordova prepare`; done means the app opens normally without the `ERR_FILE_NOT_FOUND` error.

Written by the indexing model from the issue text.

Assessment

Tech stack
electron, javascript, nodejs
Domain
build-system, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.