Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tysoncadenhead opened this issue Aug 9, 2021 · 1 comment
Open

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

tysoncadenhead opened this issue Aug 9, 2021 · 1 comment

Comments

@tysoncadenhead
Copy link

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
@erisu
Copy link
Member

erisu commented Sep 17, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants