webdev03 / scratchinfo

A scratch stat viewer thing
https://scratchinfo.vercel.app
MIT License
11 stars 6 forks source link

Basic HTML or bug? #58

Closed ghost closed 2 years ago

ghost commented 2 years ago

Describe the bug I was having internet issues and I reloaded the page and the CSS was apparently deactivated.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'scratchinfo.varcel.app'
  2. Click on the bottom of your screen:
  3. image

  4. turn your wifi off
  5. go on a different tab
  6. reopen scratchinfo
  7. See error
  8. Idk if this will work 🤔

Expected behavior Proper design: image

Screenshots image

Desktop (please complete the following information):

Smartphone (please complete the following information): none

Additional context Add any other context about the problem here.

hello-smile6 commented 2 years ago

@webdev03 Caching issue, you need to add a service worker.

webdev03 commented 2 years ago

Hmm...

webdev03 commented 2 years ago

Can't recreate the issue.. and @hello-smile6 I think SvelteKit has a service worker (not sure)

JoshAtticus commented 2 years ago
  • OS: Chromebook?
  • Browser Chrome
  • Version 97

It's ChromeOS

ghost commented 2 years ago

@JoshAtticus Thanks

hello-smile6 commented 2 years ago

Can't recreate the issue.. and @hello-smile6 I think SvelteKit has a service worker (not sure)

Doesn't have one, use Workbox and add it to your build script so it runs after you build your code. Workbox will let your API endpoints fall through.

webdev03 commented 2 years ago

I can add my own service worker, just add it in src/service-worker.ts, I just don't know what to put in there.. @hello-smile6 can you please make PR for it?

hello-smile6 commented 2 years ago

I can add my own service worker, just add it in src/service-worker.ts, I just don't know what to put in there.. @hello-smile6 can you please make PR for it?

Can't be typescript, has to be .js . Let me see...

webdev03 commented 2 years ago

Just make it .ts since sveltekit transpiles that to JS. You don't need to know TS.

hello-smile6 commented 2 years ago

Or, you could build the service worker once you generate the static site, right before deploying it to Vercel's CDN.

hello-smile6 commented 2 years ago

Google

webdev03 commented 2 years ago

Or, you could build the service worker once you generate the static site, right before deploying it to Vercel's CDN.

How to generate one?

hello-smile6 commented 2 years ago

Or, you could build the service worker once you generate the static site, right before deploying it to Vercel's CDN.

How to generate one?

npx workbox-cli, find the create one. Run your build first and output your service worker in the build output. Then, after you build it, run npx workbox-cli generateSW workbox-config.js. Also, check out https://lets-annoy-jaydendev.9pfs.repl.co/ (Thanks for pointing out their analytics)