-
-
Notifications
You must be signed in to change notification settings - Fork 522
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
webpack template: webpack-asset-relocator-loader broken with native deps #1451
Comments
Hey @NaridaL, We have the same problem as you described. Did you find any solution to fix this temporarily? |
Yup, I've excluded these modules from webpack in my const rules = require('./webpack.rules')
rules.push({
test: /\.css$/,
use: [{ loader: 'style-loader' }, { loader: 'css-loader' }],
})
module.exports = {
// Put your normal webpack config below here
resolve: {
// Add `.ts` and `.tsx` as a resolvable extension.
extensions: ['.ts', '.tsx', '.js', '.xml'],
},
module: {
rules,
},
externals: [
function(context, request, callback) {
if (
[
'bindings',
'selenium-webdriver',
'selenium-webdriver/chrome',
'electron-windows-notifications',
].includes(request)) {
return callback(null, 'commonjs ' + request)
}
callback()
},
],
} then, in my "config": {
"forge": {
"packagerConfig": {
"ignore": [
"\\.gitignore",
"node_modules/\\.cache",
".*\\.(iobj|pdb|ipdb)$"
],
"derefSymlinks": true,
"icon": "icons/app.ico"
},
...
}, Finally, I've moved all dependencies except the ones I've excluded from webpack to "dependencies": {
"electron-windows-notifications": "^3.0.6",
"selenium-webdriver": "^4.0.0-alpha.7"
},
"devDependencies": {
... lots lots more |
I got the same error. It was temporarily fixed by replacing @MarshallOfSound 's fork of the "webpack-asset-relocator-loader" with the |
This ist still happening to me. With all versions of @electron-forge above 6.0.0-beta.50, last tested with 6.0.0-beta.54 |
Preflight Checklist
Issue Details
Electron Forge Version:
Electron Version:
Operating System:
Last Known Working Electron Forge version::
Expected Behavior
The webpack template and/or the webpack-asset-relocator-loader plugin bundled with it should work with native dependencies. For example
electron-windows-notifications
, which is mentioned in the electron docs.Actual Behavior
electron forge crashes during compilation
To Reproduce
I have created a repository from the above steps. clone it and run
npm i && npm run start
to reproduce the issue: https://github.com/NaridaL/electron-forge-webpack-relocatorAdditional Information
If I'm understanding it correctly,
@marshallofsound/webpack-asset-relocator-loader
rewrites requires to*.node
files so that they still work after being moved into the.webpack
directory. Wouldn't it be simpler to not delete native dependencies when packaging and keep requires as they are?The text was updated successfully, but these errors were encountered: