Skip to content
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 #90

Closed
christophbuehler opened this issue Sep 6, 2020 · 6 comments
Closed

Cannot read property 'filename' of undefined #90

christophbuehler opened this issue Sep 6, 2020 · 6 comments

Comments

@christophbuehler
Copy link

christophbuehler commented Sep 6, 2020

Occurs when using webpack with TS-Loader.
My webpack.config.js:

module.exports = {
  target: "electron-main",
  entry: "./electron/main.ts",
  output: {
    filename: "main.js",
    path: path.resolve(__dirname, "./"),
  },
  plugins: [
    ElectronReloadPlugin(),
  ],
  module: {
    rules: [
      {
        test: /\.tsx?$/,
        use: {
          loader: "ts-loader",
          options: {
            configFile: "electron/tsconfig.json",
          },
        },
        exclude: /node_modules/,
      },
    ],
  },
  resolve: {
    extensions: [".tsx", ".ts", ".js"],
  },
  node: {
    __dirname: false,
    __filename: false,
  },
};
@christophbuehler christophbuehler changed the title Simple fix for: Cannot read property 'filename' of undefined Cannot read property 'filename' of undefined Sep 6, 2020
@yan-foto
Copy link
Owner

yan-foto commented Sep 6, 2020

We already discussed this in #66. The bottom line is: there is no valid use case for packing electron-reload with webpack.

@yan-foto yan-foto closed this as completed Sep 6, 2020
@christophbuehler
Copy link
Author

I am using TypeScript for my Electron main process code.

@christophbuehler
Copy link
Author

You are right, same fix. Is there a timeline on when this fix will be introduced?

@yan-foto
Copy link
Owner

yan-foto commented Sep 6, 2020

Sorry for quickly closing your issue and PR. I have little to no time to maintain this repository and am looking for a maintainer, so I cannot tell when everything moves forward. If I get enough time, I'll review and merge the blocking PR.

@christophbuehler
Copy link
Author

Not a problem, thanks for the quick response.

@yan-foto
Copy link
Owner

yan-foto commented Sep 6, 2020

If you are interested in contributing to this project and are using TS, you could give #79 a try and make sure everything works well. Merging that would also solve your problem and would be a really great help to me. 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants