Open aistrych opened 4 years ago
I worked it around with this
module.id = '.';
module.path = '.';
require = require('esm')(module);
require('./renderer.js')
but when I imported openlayers, stranges thing happened. it works on the first load, but fails after reload (by menu). If I keep reloading again and again, it will work, fail, work, fail, work, fail....
Update: I made it work always by disabling cache.
Christ, any one figure this one out? I'm running out of ideas
I have same issue, anyone found a solution or workaround for this issue?
After upgrading electron and esm versions to the newest ones (in https://github.com/standard-things/electron-quick-start) esm loader for renderer process stopped working with errors:
"Uncaught /path_to_my_project_dir/electron-quick-start/index.html:1 Error: Cannot find module './renderer.js' Require stack:
Requiring module from node_modules like this:
works without issues.
Here are my changes for electron 8 (but issue exists for electron 6 and 7 as well): https://github.com/Astrych/electron-quick-start/commit/9ca5498beacf08d1572ffee05df385faad261dd0
With electron 4 and 5 everything works just fine.