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

Please check my installation #30

Open
bsde1245 opened this issue May 4, 2019 · 15 comments
Open

Please check my installation #30

bsde1245 opened this issue May 4, 2019 · 15 comments

Comments

@bsde1245
Copy link

bsde1245 commented May 4, 2019

Hi,
Thanks for this plugin. I am a newbie.
I tried to add this plugin in my website here. Repo is this. I can't see the pwa notification. Which step I am missing.

@souldanger
Copy link
Collaborator

Hello
best to use the Chrome console/dev tools in order to see if the script is loading. You'll also see that your website produces a few 404's...
As far as I can see, the script is not loading on your website.

@bsde1245
Copy link
Author

bsde1245 commented May 4, 2019

Which script should I look for?
Those 404's can be fixed by adding, {{site.baseurl}}. But is that enough?

@bsde1245
Copy link
Author

bsde1245 commented May 5, 2019

Locally I get

workbox Welcome to Workbox! /assets/js/workbox-v3.6.3/workbox-core.dev.js:132:21
workbox Precaching is responding to: / /assets/js/workbox-v3.6.3/workbox-core.dev.js:132:21
workbox Precaching is responding to: /js/footer.js /assets/js/workbox-v3.6.3/workbox-core.dev.js:132:21
workbox Welcome to Workbox! workbox-core.dev.js:132:21
workbox Precaching 0 files. 9 files are already cached. workbox-core.dev.js:132:21

in console. But in site I can't see this.

@souldanger
Copy link
Collaborator

perfect!
You can only see this in dev mode but not when live - this is intentional!
This means its working perfectly fine.
Now when you open the website on your mobile device, it'll ask you to install it and the icon as defined in your manifest will appear on your home screen.

@bsde1245
Copy link
Author

bsde1245 commented May 5, 2019

But in my site here I get Service worker is not registered or does not control the Start URL in Application tab of console. I can access https://forumkeralam.ml/service-worker.js but can't access https://forumkeralam.ml/assets/js/workbox-v3.6.3/workbox-sw.js or https://forumkeralam.ml/assets/js/workbox-v3.6.2/workbox-sw.js

@bsde1245
Copy link
Author

bsde1245 commented May 6, 2019

Locally in http://localhost:4000/service-worker.js I have

                        importScripts("/assets/js/workbox-v3.6.3/workbox-sw.js");
            workbox.setConfig({modulePathPrefix: "/assets/js/workbox-v3.6.3"});

            self.__precacheManifest = [{"url":"/js/footer.js","revision":"b3f41834b1eb54df1a50d30c2bde6556"},{"url":"/js/lunr.min.js","revision":"57fc8edbd9ac8ed0e94dbfca3f722ea8"},{"url":"/js/search.js","revision":"8043965b6a3727e172b7b4b7f03a4bc0"},{"url":"/index.html","revision":"cfbd3aa3bf6a70aa35cf8c085f6b4c04"},{"url":"/howto/2016/12/28/How-to-download-wikipedia-and-use-offline.html","revision":"16aaca7174ea6c0fb20e7258f6898432"},{"url":"/howto/2016/12/08/how-to-type-malayalam-in-android-phone-easily.html","revision":"f648f26613ff54d460b07daf4b7bfa83"},{"url":"/howto/2016/11/23/how-to-download-videos-from-youtube-without-any-software-easily.html","revision":"7e006a4803d1cb44f4a40e09d11bbb84"},{"url":"/howto/2016/11/17/How-to-download-softwares-and-movies-files-from-torrent-sites.html","revision":"69c43b33d24b9d54c3202c1cccf7a94b"},{"url":"/howto/2016/11/16/How-to-take-screenshot-of-monitor-screen.html","revision":"6d4bc63c8dde28e06a3dacc8505f24e2"}];
            
            workbox.core.setCacheNameDetails({
    prefix: 'xiaop-blog',
    suffix: 'v1',
    precache: 'precache',
    runtime: 'runtime-cache'
});

workbox.skipWaiting();
workbox.clientsClaim();

workbox.precaching.precacheAndRoute(self.__precacheManifest);

workbox.routing.registerRoute(
    /\.html$/,
    workbox.strategies.networkFirst()
);

workbox.routing.registerRoute(
    /assets\/(img|icons)/,
    workbox.strategies.cacheFirst()
);

workbox.routing.registerRoute(
    /^https?:\/\/cloud.netlifyusercontent.com/,
    workbox.strategies.staleWhileRevalidate()
);

workbox.routing.registerRoute(
    /^https?:\/\/cdn.staticfile.org/,
    workbox.strategies.staleWhileRevalidate()
);

workbox.routing.registerRoute(
    /^https?:\/\/at.alicdn.com/,
    workbox.strategies.staleWhileRevalidate()
);


But on site in https://forumkeralam.ml/service-worker.js I have

workbox.core.setCacheNameDetails({
    prefix: 'xiaop-blog',
    suffix: 'v1',
    precache: 'precache',
    runtime: 'runtime-cache'
});

workbox.skipWaiting();
workbox.clientsClaim();

workbox.precaching.precacheAndRoute(self.__precacheManifest);

workbox.routing.registerRoute(
    /\.html$/,
    workbox.strategies.networkFirst()
);

workbox.routing.registerRoute(
    /assets\/(img|icons)/,
    workbox.strategies.cacheFirst()
);

workbox.routing.registerRoute(
    /^https?:\/\/cloud.netlifyusercontent.com/,
    workbox.strategies.staleWhileRevalidate()
);

workbox.routing.registerRoute(
    /^https?:\/\/cdn.staticfile.org/,
    workbox.strategies.staleWhileRevalidate()
);

workbox.routing.registerRoute(
    /^https?:\/\/at.alicdn.com/,
    workbox.strategies.staleWhileRevalidate()
);

It is working locally, but on github pages it not works :(

@souldanger
Copy link
Collaborator

looks like the gem doesn't work when you deploy your site.
check your build/deploy procedures.

@bsde1245
Copy link
Author

bsde1245 commented May 6, 2019

I issued following commands
git add .
git commit -am "update"
git push origin gh-pages

@souldanger
Copy link
Collaborator

Sorry, I don't use gh-pages, so can't help...

@bsde1245
Copy link
Author

bsde1245 commented May 6, 2019

Okey, Thanks for the support

@bsde1245
Copy link
Author

bsde1245 commented May 6, 2019

I think there is a bug with gem version 2.2.2, script is looking for the folder workbox-v3.6.2 but the real folder exists is workbox-v3.6.3. And for some reason gem version 2.2.3 is not working with gh-pages.

@souldanger
Copy link
Collaborator

Don't worry, the Workbox files are stored with the gem, so this can't be the issue.
do you get any feedback from gh pages as described here:
https://help.github.com/en/articles/troubleshooting-github-pages-builds

@bsde1245
Copy link
Author

bsde1245 commented May 6, 2019

I don't have any build errors with my repo. It was a success

@souldanger
Copy link
Collaborator

hmmm, in which case the gem should work.
I would recommend to check gh pages help docs. There's a good chance that gh-pages only allows certain gems...

@bsde1245
Copy link
Author

bsde1245 commented May 6, 2019

Ohhh! That may be the issue. Thanks for pointing that.

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