firebase-module icon indicating copy to clipboard operation
firebase-module copied to clipboard

@nuxtjs/firebase + @nuxtjs/pwa/workbox conflict

Open mentAl-maZe opened this issue 4 years ago • 11 comments

Version

@nuxtjs/firebase: 5.0.7 @nuxtjs/pwa: 3.0.0-beta.20 firebase: 7.14.2 nuxt: 2.12.2

Reproduction Link

https://github.com/m2sd/nuxt-firebase-pwa-test

Steps to reproduce

Follow the steps in the repo

What is Expected?

Firebase ssr auth and Workbox should work in conjunction so that requests are augmented with authorization AND cached

What is actually happening?

Either Firebase ssr auth OR Workbox take precedence, the other one is skipped completely

Possible solutions

We could replace the page caching from workbox with our own implementation and configure according to the settings in options.pwa.workbox.

Downside: This creates a direct dependency on workbox, but as the @nuxtjs/pwa is the de facto standard for PWA implementations this could be a viable option.

Upside: The necessary change might be small enough that it could be implemented conditionally (if workbox is present => include as routingExtension, else => include as standalone SW)

mentAl-maZe avatar Apr 28 '20 22:04 mentAl-maZe

PS: sorry it took me so long to notice :disappointed: However, this issue affects this module even without my changes...

mentAl-maZe avatar Apr 28 '20 22:04 mentAl-maZe

Hey @mentAl-maZe

Thanks for reporting. Can you hit me up on Discord so we can talk about this issue? You should be able to find me as "lupas" in the Nuxt Discord community.

I cannot properly reproduce your issue - for me offline caching seems to work fine and I never had issues with authentication not working either. But I am not a workbox expert so I believe you know more than me, would be great if you could guide me through.

I don't think we should be ending up implementing workbox functionality into this module though. So I hope we can find another solution for that.

lupas avatar May 01 '20 09:05 lupas

I have created a workbox plugin to achieve interoperability. Still we need a way to integrate it with @nuxtjs/pwa somehow. I think an integration with the PWA module is the way to go as people who want to use service worker sessions profit from using the module anyway.

I think the best solution would be to find a way to configure the PWA Workbox module so that it we can integrate this module seamlessly with it and provide an automatic configuration in future versions (of this module or the SSR extension)

mentAl-maZe avatar May 03 '20 09:05 mentAl-maZe

@mentAl-maZe Any news on this? How should we proceed here?

lupas avatar Jun 07 '20 19:06 lupas

@lupas Hi lupas sorry for the long silence, i've been crazy busy and it is hard to find the time for foss... :disappointed:

I'll try to get into it again over the next week, but as of now i can't make any promises... I'm sorry

mentAl-maZe avatar Jun 17 '20 07:06 mentAl-maZe

@mentAl-maZe This is open-source, I'm not expecting you to do anything ;-) Everything you do is more than appreciated! :-) I'm super busy myself these days and can't get anything done here..

Thanks for the heads up!

lupas avatar Jun 17 '20 07:06 lupas

Hey I'm running into this problem! Is there any way to patch it at least temporally? I'm really new to webdev

alexndr-n avatar Aug 19 '20 23:08 alexndr-n

Hey, are there any updates on this? Thank you

ghost avatar Nov 11 '20 12:11 ghost

@alanlobeslab Not yet... Had a look at it but couldn't find a simple solution and then run out of time.. not sure when this can be fixed. If someone has any ideas, please let me know :)

lupas avatar Nov 12 '20 12:11 lupas

Thanks for replying @lupas. As a temporary fix, I used this which actually references your work. I replaced nuxt-fire with nuxt/firebase.

ghost avatar Nov 12 '20 12:11 ghost

How's this issue coming along? The article referenced by @alanlobeslab didn't do it for me.

LeeGrobler avatar Mar 18 '21 05:03 LeeGrobler