Nuxt.js: issue with the offline plugin with CDN

Created on 1 Jun 2017  路  5Comments  路  Source: nuxt/nuxt.js

Hello,

I'm facing a problem with the offline plugin while hosting my assets in a CDN it's giving me this error.

Uncaught (in promise) DOMException: Failed to register a ServiceWorker: The origin of the provided scriptURL ('https://cdn.domain.com') does not match the current origin ('https://domain.com').

How can i fix that should we host the sw.js in the /static folder if so can we do that automatically ?

This question is available on Nuxt.js community (#c707)
help-wanted

Most helpful comment

It got score of 100 on lighthouse tests.

All 5 comments

@dyaa we are currently working on refactoring the offline module to make it external of Nuxt.js.

When ready, we'll be able to help you :)

Hi @dyaa . We are working a new generation service worker from chrome team, workbox. Will be so nice if hear your feedbacks on it. Basically it should support CDN as well. Also about sw.js yes it is automatically copied to static dir by this module.

Thanks @pi0 i'll try in now :+1: ...

It got score of 100 on lighthouse tests.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lazycrazy picture lazycrazy  路  3Comments

vadimsg picture vadimsg  路  3Comments

uptownhr picture uptownhr  路  3Comments

pehbehbeh picture pehbehbeh  路  3Comments

maicong picture maicong  路  3Comments