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

[6.x] webpack plugin requires output.publicPath = '/' in renderer webpack config otherwise 404 error occurs on hot module reload #713

Closed
3 tasks done
c4ss opened this issue Mar 11, 2019 · 2 comments

Comments

@c4ss
Copy link

c4ss commented Mar 11, 2019

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Without

output: {
  publicPath: '/',
},

in renderer config hot module reloading will respond with a 404 error e.g.

image

Should this be added to the base config?

NOTE: this is only for dev 'start' builds and will actually break production builds

@MarshallOfSound
Copy link
Member

Should this be added to the base config?

If this is indeed the case, I'll give it a quick test

@c4ss
Copy link
Author

c4ss commented Mar 15, 2019

Version info

webpack 4.29.6
webpack-dev-middleware 3.6.1
webpack-hot-middleware 2.24.3

shimaore added a commit to shimaore/electron-forge that referenced this issue Jul 14, 2019
malept pushed a commit that referenced this issue Jul 15, 2019
* webpack plugin: properly references `index.js`

When building an executable using `electron-force make`, setting `publicPath` as `/` leads (for example) to `index.js` being referenced as `file:///main_window/index.js`, which cannot be found. (The URL points to `/main_window/index.js`, which is incorect. It should be `../main_window/index.js`.)

When it is unset, the build runs properly and provides the correct URL. (This still works with `electron-forge start` as well.)

* publicPath is needed for hot module reloading

As noted in #713

* correct syntax
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