Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service Worker is not getting installed #1

Open
SarangIngole opened this issue May 13, 2020 · 0 comments
Open

Service Worker is not getting installed #1

SarangIngole opened this issue May 13, 2020 · 0 comments

Comments

@SarangIngole
Copy link

Hi Brett,

Thanks for this POC.

This is really helpful to understand how the PWA works in Salesforce.

I downloaded the code from github and then pushed it to my scratch org. When I am accessing the "Scoreboard" or "/apex/pwa#/" it tries to register the service worker but the browser is giving error

pwa#/:1 Uncaught (in promise) DOMException: Failed to register a ServiceWorker for scope ('https://drive-momentum-5993-dev-ed--c.visualforce.com/') with script ('https://drive-momentum-5993-dev-ed--c.visualforce.com/apex/pwasw'): The path of the provided scope ('/') is not under the max scope allowed ('/apex/'). Adjust the scope, move the Service Worker script, or use the Service-Worker-Allowed HTTP header to allow the scope

I am wondering is there any issue with the folder structure where pwasw.js is located and the page it tries to access.

Please let me know if there are any changes required in the location of the file or need to define the scope.

Also in the source code, scorebord.json file has below parameters
"start_url": "https://scoreboard.force.com/volunteer",
"scope":"/volunteer/",

Really wondering what needs to mention here.

I really appreciate your help.

Thanks,
Sarang

VS Code Folder Structure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant