Expand all | Collapse all

Service Worker

  • 1.  Service Worker

    Posted 12-05-2018 21:04
    I am working on implementing changes with Service Workers. I am following the series of posts from Dan Diebolt, Service Worker Travel Logs, and it is making sense. The one part I am stuck on is in the last one; https://community.quickbase.com/quickbase/topics/service-worker-travel-log-day-13, specifically implementing the cheerio.js library. Do I need to bring over every file in the GitHub page, or is there a way to simply reference them all at once?

  • 2.  RE: Service Worker

    Posted 12-05-2018 21:11
    No just import cheerio.js itself. A Service Worker has no access to the DOM so libraries such as jQuery which presupposes a DOM will not work. Cheerio restores that capability to the Service Worker. However, I would think carefully if you really need it as most Service Workers do not need access to the DOM.

    Service Workers are the future. Alas, you have to repeat new concepts a hundred times before enlighten, bleeding edge, avant garde users such as yourself pickup on the innovation.

  • 3.  RE: Service Worker

    Posted 12-05-2018 21:17
    So I had thought about that and checked that. When I use the import, I get an error in the console: bk64mv5j9?a=dbpage&pagename=cheerio.js:5 Uncaught ReferenceError: require is not defined.

  • 4.  RE: Service Worker

  • 5.  RE: Service Worker

    Posted 12-05-2018 21:30
    After looking back through my code, I figured out that I had forgotten that as a part of your request on day 12, you specify your own table information, after adjusting it to reference the correct table dbid and apptoken, it now works.

  • 6.  RE: Service Worker

    Posted 12-05-2018 21:33
    Great - you can type up your experience for Day 13. I got bored with the 30 day travel log as there weren't enough early adopters such as yourself. But I use Service Workers elsewhere (no QuickBase) and they are incredible.

  • 7.  RE: Service Worker

    Posted 12-07-2018 19:27
    I'm still trying to get it to work, I get an error telling me that the require command does not exist, and when I try to access the link that you sent me, it requires me to log in. I was going to check your code for cheerio.js, to see if it a different version, because your version is probably at least a year older than the one I got from GitHub.

  • 8.  RE: Service Worker

    Posted 12-07-2018 20:13
    I am not even going to venture a guess what the problem might be. Service Workers are sufficiently complicated that I would have to see both the code and the application to debug.

    However, once you get it working it will work flawlessly if you keep to the same pattern.

    If you need individualized help feel free to contact me off-world using the information in my profile: