Describe the bug
The automatically generated paths for detected electron plugins are an absolute path to the developers machine. Hence, when packaging the app and installing it on another computer the application will fail, saying not finding the module.
To Reproduce
Steps to reproduce the behavior:
Create and build a plugin using the plugin example
Import the plugin into an application
The plugin is detected and added to the file ' src/rt/electron-plugins.js' with an absolute path (Users/xxx/Project/..../electron/node_modules/my-custom-plugin/electron/dist/plugin.js for mac and C:\Users\xxx\Project\...\electron\node_modules\my-custom-plugin\electron\dist\plugin.js for windows)
The application works on local PC as the absolute path is OK.
When packaging the application and running on another PC it yields the following error:
Error: Cannot find module 'C:/Users/xxx/Project/.../electron/node_modules/my-custom-plugin/electron/dist/plugin.js'
Require stack:
at Function.n._resolveFilename (electron/js2c/browser_init.js:257:1128)
at Function.f._load (electron/js2c/asar_bundle.js:5:12913)
at Object. (- C:/Users/OtherUser/AppData/Local/Programs/Project/resources/app.asar/build/src/rt/electron-plugins.js:2:34)
Expected behavior
A relative path to properly detect the plugin.
For windows '.\..\..\..\node_modules\my-custom-plugin\electron\dist\plugin.js' worked. Does not seem to work on mac.
Desktop (please complete the following information):
OS: [Windows, mac]
Additional context
electron-builder was used to package the application.
Describe the bug The automatically generated paths for detected electron plugins are an absolute path to the developers machine. Hence, when packaging the app and installing it on another computer the application will fail, saying not finding the module.
To Reproduce Steps to reproduce the behavior:
at Function.n._resolveFilename (electron/js2c/browser_init.js:257:1128) at Function.f._load (electron/js2c/asar_bundle.js:5:12913) at Object. (- C:/Users/OtherUser/AppData/Local/Programs/Project/resources/app.asar/build/src/rt/electron-plugins.js:2:34)
Expected behavior A relative path to properly detect the plugin. For windows '.\..\..\..\node_modules\my-custom-plugin\electron\dist\plugin.js' worked. Does not seem to work on mac.
Desktop (please complete the following information):
Additional context electron-builder was used to package the application.