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

Cannot find module: './cdv-electron-settings.json'

Open tysoncadenhead opened this issue 2 years ago • 1 comments

Bug Report

Problem

I am able to build an Electron in Windows10, but when I try to install it, I'm getting an error that says Cannot find module: './cdv-electron-settings.json'

Screen Shot 2021-08-09 at 2 04 39 PM

Information

build.json

{
  "electron": {
    "windows": {
      "package": ["zip"]
    }
  }
}

config.yml

<?xml version='1.0' encoding='utf-8'?>
<widget id="com.sageipad.sage" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <content src="index.html" />
    <access origin="*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <platform name="electron">
        <preference name="ElectronSettingsFilePath" value="res/electron/settings.json" />
    </platform>
    <hook type="before_prepare" src="scripts/prebuild.js" />
    <preference name="EnableViewportScale" value="true" />
</widget>

res/electron/settings.json

{
    "browserWindow": {
        "width": 1024,
        "height": 768,
        "resizable": true
    }
}

Environment, Platform, Device

Electron on Windows 10

Checklist

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

tysoncadenhead avatar Aug 09 '21 19:08 tysoncadenhead

I tried locally and was unable to reproduce this issue on Windows 10.

Could you confirm if you still have this problem? Also, maybe try with the latest Cordova Electron 3.0.0?

To upgrade:

cordova platform remove electron
cordova platform add [email protected]

I noticed you had a hookscript , scripts/prebuild.js, which maybe is causing the issue.

erisu avatar Sep 17 '21 13:09 erisu