-
Notifications
You must be signed in to change notification settings - Fork 55
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
Cannot read property 'filename' of undefined #66
Comments
I see this issue, but the method don't work. externals: {
'electron-reload': 'electron-reload',
}, Result:
|
I've created a repository to test this situation. |
I see the problem that is in the WebPack. So I've found a solution to the problem. You should add a section to a config file. node: {
__dirname: false
} Maybe, add this information to the README file? WebPack example configconst path = require('path');
module.exports = {
mode: "development",
target: 'electron-main',
entry: {
main: './src/main.js'
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].js'
},
module: {
rules: [{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
babelrc: false,
presets: ['@babel/preset-env']
}
}
}]
},
node: {
__dirname: false
}
} |
Hi @valentineus , thanks for getting involved in this project, but as you already found out, this is not a bug within |
What is the problem
I get an error if I use package versions 1.5.0 or 1.4.1.
The package is work if I change line 12 to
const mainFile = ''
.Code
console.log(module.parent)
display thatmodule.parent
equalsundefined
.Additional information
main.js
Used packages
The text was updated successfully, but these errors were encountered: