electron-webpack icon indicating copy to clipboard operation
electron-webpack copied to clipboard

Electron-webpack not working with webpack5

Open shahkeyur opened this issue 3 years ago • 39 comments

Hey,

I am using these dev dependencies as a starter project.

    "electron": "^10.1.5",
    "electron-webpack": "^2.8.2",
    "webpack": "^5.2.0"

But the electron-webpack seems to be incompatible with the breaking change from webpack 5. I looked at webpack docs, it says namedImports are removed in v5. I tried changing optimization.namedModules: true ↦ optimization.moduleIds: 'named' in forked repository and I can confirm it works on development, but not sure how to make it compatible with v4 and v5 at same time. Is there anyway it can be solved ? Then I can create a pull request.

┏ Renderer -------------------

  × 「wds」: Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
   - configuration.optimization has an unknown property 'namedModules'. These properties are valid:
     object { checkWasmTypes?, chunkIds?, concatenateModules?, emitOnErrors?, flagIncludedChunks?, innerGraph?, mangleExports?, mangleWasmImports?, mergeDuplicateChunks?, minimize?, minimizer?, moduleIds?, noEmitOnErrors?, nodeEnv?, portableRecords?, providedExports?, realContentHash?, removeAvailableModules?, removeEmptyChunks?, runtimeChunk?, sideEffects?, splitChunks?, usedExports? }
     -> Enables/Disables integrated optimizations.
     Did you mean optimization.moduleIds: "named" (BREAKING CHANGE since webpack 5)?

┗ ----------------------------

Thanks.

shahkeyur avatar Oct 27 '20 07:10 shahkeyur

Same here ✋🏻

alii avatar Nov 01 '20 01:11 alii

Fortunately webpack now exposes its version now. The named modules issue seems to be the only one for now. Let's see what else comes.

loopmode avatar Nov 01 '20 09:11 loopmode

@loopmode Woohoo! I see it is merged in the repo but when I install electron-webpack with npm, I don't see it using the updated baseTarget version in node_modules. Therefore it still throws error. Is there any known reason ?

You guys are doing great work. I am trying these days to look into repo further and try to improve, but I am a beginner to contribute to open-source. Hopefully I can contribute something to the community here.

shahkeyur avatar Nov 06 '20 08:11 shahkeyur

@shahkeyur Hey glad to hear you wanna get your hands dirty. It's a good thing to get involved, You learn a lot.

About the merge: so the codebase has been updated, however there has not been a release to npm yet. I think I have the permissions for that, but so far only @develar does the releases. In general, codebase and release are not directly synced.

What you could do is pull this repo, install and build locally, then use it in your project via symlink. My experience with npm is limited as I had trouble and switched to yarn. In the local electron-webpack, installed and built, you run npm link or yarn link. This creates a symlink to this local folder somewhere more globally. Then in your project you run npm link electron-webpack or yarn link electron-webpack to use that linked local version.

Once there is a release, you can use the package installed from npm again. Note that if you delete and reinstall your node_modules, you'll have to run the second step again (to override the installed package with the linked one).

loopmode avatar Nov 06 '20 12:11 loopmode

Do you think we can expect a release with updated dependencies anytime soon? Specifically this and https://github.com/electron-userland/electron-webpack/issues/402 (among others, dependencies move fast and it's been about 7 months since the last release).

dscalzi avatar Nov 10 '20 00:11 dscalzi

@dscalzi +1.

shahkeyur avatar Nov 10 '20 07:11 shahkeyur

@develar We would really appreciate a release with what is in master currently.

neb-b avatar Nov 18 '20 20:11 neb-b

How about this issue's progress?

xland avatar Dec 23 '20 08:12 xland

can we expect a release soon? TIA

UXDart avatar Dec 24 '20 12:12 UXDart

What's stopping the release? How can we help?

lazarljubenovic avatar Dec 26 '20 09:12 lazarljubenovic

Any update?

keithslater avatar Jan 01 '21 16:01 keithslater

Could we perhaps get a release on NPM with a beta tag? 🙂

Eli-Black-Work avatar Jan 14 '21 10:01 Eli-Black-Work

Hi,guys

the same problem, I modified node_modules/electron-webpack/out/targets/BaseTarget.js manually :

configurator.config.optimization.namedModules = true; to // configurator.config.optimization.namedModules = true;

it works.

my package.json

{
  "devDependencies": {
    "electron": "^11.2.1",
    "electron-webpack": "^2.8.2",
    "webpack": "^5.17.0"
  },
  "name": "demoShow",
  "version": "1.0.0",
  "scripts": {
    "start": "electron-webpack dev",
    "build": "electron-webpack build"
  },
  "license": "MIT"
}

kumakichi avatar Jan 26 '21 03:01 kumakichi

Will this be getting a release anytime soon? Also looking to use this with WP5

joezappie avatar Feb 03 '21 00:02 joezappie

@SentoxAIO, Do you have permissions to publish to NPM?

Eli-Black-Work avatar Feb 03 '21 02:02 Eli-Black-Work

can we know at least if this won't never happen? thx

UXDart avatar Feb 04 '21 13:02 UXDart

too many things now needs webpack 5, how is everyone working with that? are you using the repo directly? thx

UXDart avatar Feb 04 '21 14:02 UXDart

Same here, cloned electron-webpack master built and linked it ijn my projects... Thanks for not releasing lol @develar

ogomez92 avatar Feb 06 '21 05:02 ogomez92

Is it possible to get the yarn linked electron-webpack to use with the cli? Right now when I do yarn electron-webpack it says that the binary isn't found and it tries to look for it inside the node_modules of the project ☹️ I trried yarn remove elctron-webpack then yarn link electron-webpack then yarn add electron-webpack again same thing. Thanks.

ogomez92 avatar Feb 06 '21 07:02 ogomez92

@ogomez92 I think you have to build or compile your local electron-webpack, then the link should work. And the link should be in packages/electron-webpack, not in the repo root. If all fails, you could place your local repo "close to" your consuming project and use a relative file path I'm package.json, e.g "electron-webpack": "file:../../electron-webpack/packages/electron-webpack", and run an install afterwards. This would install a copy from there to your local node_modules folder. But again: electron-webpack must have been built beforehand.

I'm not sure but I might have permissions to make an npm release. I spoke about it with @develar once, and I was supposed to enable 2FA for my npm account first. Im not sure how it all ended up, but I never have released a version since.

For now however 1) I don't know the routine, what needs to be done before release and 2) i don't really have the time to take care and figure it out. But I guess it's worth it. I will check out whether and how I can publish a beta if and when i find the time between newborn daughter and job-work :)

Btw maybe we need an issue regarding responsibility and maintenance. We need active users who do that, and it seems active users we have. We should get a couple of trustworthy guys together and maybe just do a zoom call or something. Of course with @develar too. Point is: i have status of maintainer here, but I haven't used electron-webpack in years...I'm not a good maintainer :) we need good, active ones.

loopmode avatar Feb 06 '21 08:02 loopmode

Sorry, but how do I build or compile electron-webpack? I'm fairly new to this, I'm used to installing packages and importing them into projects but I dunno how to rebuild dependencies...

On 2/6/21, Jovica Aleksic [email protected] wrote:

@ogomez92 I think you have to build or compile your local electron-webpack, then the link should work. And the link should be in packages/electron-webpack, not in the repo root. If all fails, you could place your local repo "close to" your consuming project and use a relative file path I'm package.json, e.g "electron-webpack": "file:../../electron-webpack/packages/electron-webpack", and run an install afterwards. This would install a copy from there to your local node_modules folder. But again: electron-webpack must have been built beforehand.

I'm not sure but I might have permissions to make an npm release. I spoke about it with @develar once, and I was supposed to enable 2FA for my npm account first. Im not sure how it all ended up, but I never have released a version since.

For now however 1) I don't know the routine, what needs to be done before release and 2) i don't really have the time to take care and figure it out.

But I guess it's worth it. I will check out whether and how I can publish a beta if and when i find the time between newborn daughter and job-work :)

Btw maybe we need an issue regarding responsibility and maintenance. We need active users who do that, and it seems active users we have. We should get a couple of trustworthy guys together and maybe just do a zoom call or something. Of course with @develar too. Point is: i have status of maintainer here, but I haven't used electron-webpack in years...I'm not a good maintainer :) we need good, active ones.

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/electron-userland/electron-webpack/issues/408#issuecomment-774423274

ogomez92 avatar Feb 06 '21 08:02 ogomez92

@loopmode Is this something the community could fork and maintain as a new repo entirely? Since both PRs and releases aren't really happening here.

alii avatar Feb 06 '21 09:02 alii

@Bosch-Eli-Black No, I can't push any new release, that's why I stopped working on it.

sentoxaio avatar Feb 06 '21 10:02 sentoxaio

@ogomez92 it's yarn compile in the project root, of course after yarn or yarn install once. @alii yes of course, that's possible. however that has been possible for years now, but the "community" of this project, unfortunately, hasn't done that. I'd actually love to do that, @loopmode/electron-webpack, and get rid of module whitelisting and externals etc. But I wouldn't be able to maintain it - i don't actively work with electron in my day-job. As mentioned, if there are people actively working with this, they should be maintaining the package. Be it here or as a fork. And scoped/different package name.

loopmode avatar Feb 06 '21 10:02 loopmode

If someone willing to help, I can grant push permission (as it was granted to @loopmode, thanks for his work and help).

develar avatar Feb 06 '21 10:02 develar

Btw... I personally am a bit afraid to make release a new version. What if a PR fixes issue XY for user AB but breaks something for all the other users? I don't wanna be responsible for such a mess. And that's why a maintainer should be actively working with the library.

loopmode avatar Feb 06 '21 10:02 loopmode

@loopmode In this case next tag should be used for release, and in a couple of days/weeks promoted as stable.

develar avatar Feb 06 '21 10:02 develar

@develar great to hear from you!

Still, what I mean is... I'd feel very bad releasing a new version without spending time with it, like just because some people made pressure. Because if something is not okay - and it often isn't with deployments or releases - then you can't just leave it at that, you must keep fixing until it's good. Just doing the release and not supporting it would be irresponsible, and that's why I don't feel okay making a release. In fact I only participate in discussions here on my mobile phone, many times in a short break, while in the bus or at the toilet 😸 that's almost all the attention span i have for a library i don't actively use....

loopmode avatar Feb 06 '21 10:02 loopmode

so ... I agree that releasing without having people to fix the issues will be bad... but then that means we can't use this repo anymore... not because there is no release but because no one is working on it. is bad but we better find another solution...

UXDart avatar Feb 06 '21 14:02 UXDart

I think there are couple people who want to help / work on this project but the problem is, that it isn't very maintain friendly. The source is kinda complicated to understand at the beginning and honestly not that clean.

The key would be to redo the base a bit so that more people can get into it and work on this.

sentoxaio avatar Feb 06 '21 15:02 sentoxaio