TalAter / UpUp

✈️ Easily create sites that work offline as well as online
https://www.talater.com/upup/
MIT License
4.88k stars 264 forks source link

Error with PouchDB - Potential CORS Issue? #58

Closed chenkie closed 8 years ago

chenkie commented 9 years ago

Hello! I'm trying to get PouchDB data sync going while using UpUp, but I'm running into connection errors. I put in an issue with PouchDB, and they said it might relate to no-cors being used by the service worker: https://github.com/TalAter/UpUp/blob/master/src/upup.sw.js#L27.

I've tried removing no-cors but it didn't have any effect, so I'm wondering if it might be something else. Any ideas?

Thanks :)

vansieleghemstijn commented 8 years ago

Had some issues with this as well, changing the request to mode: "cors" fixed it for me.

https://fetch.spec.whatwg.org/#concept-request-mode

Removing it still results in "no-cors" being used.

hnordt commented 8 years ago

no-cors is used to make requests to other origins that don't have CORS headers and result in an }opaque response.

With an opaque response you can't get the data returned by request, meaning you can’t check if the request was successful.

That may be the problem. A fix would maybe changing the mode from no-cors to cors on:

https://github.com/TalAter/UpUp/blob/master/src/upup.sw.js#L27

TalAter commented 8 years ago

Sorry for the late response.

I think the latest version released today might help with this issue. I would appreciate it if you could let me know. Thank you.