morrys / offline-examples

Relay and Apollo Offline Examples
MIT License
50 stars 5 forks source link

[Next.js] service-worker.js returns 404 #5

Open kmjennison opened 5 years ago

kmjennison commented 5 years ago

The server.js should define the /service-worker.js path. Resolving it to join(__dirname, '.next', 'static', pathname) worked for me here.

Currently setting the service worker generateInDevMode to true in next.config.js fails to register the service worker.

morrys commented 5 years ago

Hi @kmjennison, the commit is on the branch that I will integrate over the weekend following the release of wora/cache-persist.

Thanks for the contribution :)

morrys commented 5 years ago

Hi @kmjennison, today I have just released major changes to offline libraries. I have updated the sample projects and integrated your modification as well. https://github.com/morrys/offline-examples/pull/6

Let me know if you find any malfunctioning.

Thanks