electron-react-boilerplate: Bug: Cannot resolve native dependencies in `app/package.json`

Hi,

Since last release (0.11.0), i can’t import modules declared in app/package.json. I changed nothing, and it was working on this commit

It results in the following error

Uncaught Error: Cannot find module 'electron-config'
    at Module._resolveFilename (module.js:470)
    at Function.Module._resolveFilename (T:\ProjetsAutre\archive-notifier\node_modules\electron\dist\resources\electron.asar\common\reset-se…:35)
    at Function.Module._load (module.js:418)
    at Module.require (module.js:498)
    at require (internal/module.js:20)
    at Object.49 (external "electron-config":1)
    at __webpack_require__ (bootstrap 6b881ca…:657)
    at fn (bootstrap 6b881ca…:85)
    at Object../app/actions/settings.js (settings.js:2)
    at __webpack_require__ (bootstrap 6b881ca…:657)

In this case it’s electron-config, but i tryed with differents modules. electron-config is installed with yarn.

app/package.json

{
  ...
  "scripts": {
    "postinstall": "npm rebuild --runtime=electron --target=1.6.1 --disturl=https://atom.io/download/atom-shell --build-from-source"
  },
  "license": "MIT",
  "dependencies": {
    "chokidar": "^1.6.1",
    "electron-config": "^0.2.1",
    "node-notifier": "^5.1.2",
    "node-yaml": "^3.0.3"
  }
}

How to reproduce

  1. Clone the project.
  2. app/package.josn
"dependencies": {
  "node-yaml": "^3.0.3"
}
  1. app/index.js
import yaml from 'node-yaml';
  1. yarn install
  2. npm run dev

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 3
  • Comments: 22 (15 by maintainers)

Most upvoted comments

@rahmatkruniawan Native deps work on master now. made this repo as an example just for you. It demos using sqlite3 with electron-react-boilerlate. Enjoy!

🎉 🎉 🎉

I try it in a few seconds.

Everything seems to work fine 😃 Thanks !

Just tested it in dev-master, works great

Will do as soon as I can! Thanks for your hard work as always @amilajack

Interesting. I’ll look into this. Thanks for reporting!