Import Not Working From Remote Require
See original GitHub issueI have a fairly large electron app I’m working on and things have generally been going ok. I want to be able to build my app in production mode so that I can start showing it around but I have been hitting snag after snag getting the build process to produce a working production Electron build.
The latest issue I’m seeing is that using import from a requireed module is failing in production builds:
(function (exports, require, module, __filename, __dirname, process, global, Buffer) { return function (exports, require, module, __filename, __dirname) { import Promise from 'bluebird';
In dev mode, everything works swimmingly. I have created a very simple app that reproduces the issue here:
https://github.com/staufman/electron-boilerplate-import-fail.git
My guess is that I have some basic misunderstanding with how require works from the renderer thread but given that everything works fine in dev but not in production, this is a bit of a head scratcher.
Note that this code is a fresh clone from the current electron-react-boilerplate but with a few small code modifications to demonstrate the issue.
Any help would be much appreciated. Thanks!
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (2 by maintainers)

Top Related StackOverflow Question
You’re right. Ideally no one would have to worry about these kinds of things. I’ll investigate further to see if i can provide a solution for this
https://stackoverflow.com/questions/35374353/es6-syntax-import-electron-require Use
instead