-
Notifications
You must be signed in to change notification settings - Fork 200
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
Bug: build/bundled prefix on service worker #2232
Comments
Sorry I just tried your repro steps and can't reproduce (everything looked fine). This was fixed in an earlier version of polymer-cli/polymer-build, you may want to try a clean reinstallation of both. |
I tried to install freshly both
but the result is the same. |
yes, I noticed there is a bug in the custom build script (gulp-tasks/project.js) if you are building on windows. Here is the full code with the fix // Returns a Promise to generate a service worker for bundled output
function writeBundledServiceWorker() {
// On windows if we pass the path with back slashes the sw-precache node module is not going
// to strip the build/bundled or build/unbundled because the path was passed in with backslash.
return polymer.addServiceWorker({
project: project,
buildRoot: bundledPath.replace('\\', '/'),
swConfig: global.config.swPrecacheConfig,
serviceWorkerPath: global.config.serviceWorkerPath,
bundled: true
});
}
// Returns a Promise to generate a service worker for unbundled output
function writeUnbundledServiceWorker() {
return polymer.addServiceWorker({
project: project,
buildRoot: unbundledPath.replace('\\', '/'),
swConfig: global.config.swPrecacheConfig,
serviceWorkerPath: global.config.serviceWorkerPath
});
} |
Thank you for this |
@eeid26 could you create an issue in the https://github.com/PolymerElements/generator-polymer-init-custom-build repo? /cc @robdodson @abdonrd |
Description
The bundled and unbundled service worker PrecacheConfig have
build/bundled
/build/unbundled
prefixVersions & Environment
Steps to Reproduce
polymer init custom-build
gulp
polymer serve build/bundled
Expected Results
Service worker will work.
Actual Results
Service worker throws a lot of 404, due to the prefix
build/bundled
that was added to the service-worker.jsCurrent Fix
After build edit service-worker.js inside the build directories (@line:32) and remove the prefix there.
From:
To:
same goes to unbundled directory, after changing them the 404 issues are gone.
The text was updated successfully, but these errors were encountered: