[Solved] T3 Stack PWA ??
Does anybody know how to turn a t3 site into a PWA? I am using next-pwa but I am getting a few errors. Here is the error I am getting.
8 Replies
If you give the
next-pwa
docs or source a read, you'll notice that next-pwa
's default export is a function that returns a function — the first function is to be called with the config for next-pwa
, the second function is to be called with your next config
https://github.com/shadowwalker/next-pwa/blob/1e6af5fa9f6a807930f451adb5ab5078d5cda451/index.js#L15
So you'd want to do something like:
Hope this helps 😄GitHub
next-pwa/index.js at 1e6af5fa9f6a807930f451adb5ab5078d5cda451 · sha...
Zero config PWA plugin for Next.js, with workbox 🧰 - next-pwa/index.js at 1e6af5fa9f6a807930f451adb5ab5078d5cda451 · shadowwalker/next-pwa
You right! I didn't notice because in the doc they used required() instead of import. I need to work on the basics and read more attentively Thank you!
I have a repo that's a T3 PWA if you want. No PWA package though, it's all done by hand: https://github.com/Sheraff/soft-serve-tunes
GitHub
GitHub - Sheraff/soft-serve-tunes: Self hosted music server on rasp...
Self hosted music server on raspberry pi. Contribute to Sheraff/soft-serve-tunes development by creating an account on GitHub.
I will check it out thxx
yo this is pretty impressive!
Thanks! The demo is a little out of date though. I wasn't trying to advertise but since it's a personal project I've sunk a few hours into, it often has good examples for other people's problems!
yeah you sunk some hours into it and it shows xD
I never really went deep into service workers so for me just seing stuff like this helps a lot
and
//sw.ts
also the service worker cached trpc calls is cool but Im not gonna pretend I understand it quite yet, nice repo!
this is my
next.config.js
file