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

Registered SW broken on iOS 16.4 #39

Open
epernice opened this issue Apr 6, 2023 · 0 comments
Open

Registered SW broken on iOS 16.4 #39

epernice opened this issue Apr 6, 2023 · 0 comments

Comments

@epernice
Copy link

epernice commented Apr 6, 2023

I have an application that is based on cra-template-pwa-typescript, which has been working great on iPads until iOS 16.4.

After updating to iOS 16.4, it no longer works. The application loads on the first load (after clearing website data, for example). Subsequent loads pull an empty index.html from the service worker and the browser displays a blank page.

I reproduced this in a minimal case by creating and deploying a new application based on cra-template-pwa-typescript. I saw the same issue.

Some extra details about how I am reproducing that may not matter

The only code change I made to the template was to register the service worker in index.tsx:

serviceWorkerRegistration.register({
  onUpdate: registration => {
    registration.waiting?.postMessage({ type: "SKIP_WAITING" });
  }
});

I made one configuration change to package.json to deploy it under a context path

  "homepage": "/testpwa",

I built it in node:16.13.2, and deployed it in nginx:1.19

Location sections from my nginx.conf are:

    location /testpwa {
        # First attempt to serve request as file, then
        # as directory, then fall back to redirecting to index.html
        alias /var/www/;

        if ( $uri = '/testpwa/index.html' ) {
          add_header Cache-Control no-store always;
        }

        try_files $uri $uri/ /testpwa/index.html;
    }

    location /testpwa/static {
        alias /var/www/static/;
        expires 1M;
        access_log off;
        add_header Cache-Control "public";
    }
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