You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 20, 2019. It is now read-only.
I then run Electron, which loads a .html file via the file:// protocol. The bundled js loads file:///sw.js, and I get a network error saying the service worker file cannot be fetched.
When I run electron, the bundled js loads file:///Users/amaurymartiny/path/to/build/sw.js, which is correct, and my service worker is loaded.
However this path is hardcoded into the bundled js, since it's done at compile time, so if I package the electron app and run it on another computer, I get another sw file cannot be fetched error.
Question
Is it possible to set the path of sw.js at runtime?
The text was updated successfully, but these errors were encountered:
I am working on an electron-vue project and I tried to use this plugin but I am facing the same issue. It works in development mode. But for production it throws a network error saying the service worker file cannot be fetched.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Config 1
My webpack config is
which ouputs a
sw.js
file in abuild/
folder.I then run Electron, which loads a .html file via the
file://
protocol. The bundled js loadsfile:///sw.js
, and I get a network error saying the service worker file cannot be fetched.Config 2
I change the webpack config to:
When I run electron, the bundled js loads
file:///Users/amaurymartiny/path/to/build/sw.js
, which is correct, and my service worker is loaded.However this path is hardcoded into the bundled js, since it's done at compile time, so if I package the electron app and run it on another computer, I get another sw file cannot be fetched error.
Question
Is it possible to set the path of sw.js at runtime?
The text was updated successfully, but these errors were encountered: