Closed lduros closed 4 years ago
I don't know how to fix this. In a quick search, I found this https://github.com/chentsulin/electron-react-boilerplate/issues/712, which describes a fix via a webpack config change. But that would require eject
of the app.
I will see if i find anything else.
Thanks for looking into it, I'll update here if I can find a solution. I guess I could use hardcoded data-uris meanwhile for images. Also, it might be a possibility to eject only within the context of building the app with electron-builder.
If your using React, Electron and react-router-dom, change your react-router-dom "BrowserRouter" to "HashRouter".
@thalessd Thank you so much!! The switch from BrowserRouter to HashRouter solved my image issues too!
If your using React, Electron and react-router-dom, change your react-router-dom "BrowserRouter" to "HashRouter".
This probably saved me sooo much time, thank you!
If your using React, Electron and react-router-dom, change your react-router-dom "BrowserRouter" to "HashRouter".
Amazing man, thank u so much!
Hello, This may not be directly an issue with this package, but whenever I use electron-builder and build a standalone electron app (dmg file, ...) everything works great for the React piece inside Electron except for the images. I can see them both in my public directory as well as in the build/ directory. However after debugging the standalone electron app, it's attempting to load the image from
while it should probably be something like this as a prod electron, I'm assuming:
Has anyone seen this behavior as well? I'm thinking a variable in .env might be the solution here, but I'm not sure what it should be.