You are reading this because you saw something like this in your SuperPWA > Settings > Status
If not, please upgrade to the latest version of SuperPWA.
Starting with SuperPWA 2.0, manifest and service worker can be either dynamic or static. For dynamic files, a custom permalink is required.
No luck? Don’t worry, lets try another option.
If your on NGINX, then you probably have the manifest, but not the service worker. Sometimes both.
This is because, the web server expects to have a static file and doesn’t load WordPress but reports a 404 directly.
Adding the following rewrite rule to the NGINX config file should do the trick. [Thanks]
rewrite ^/superpwa-manifest(-[0-9]+)?.json$ /index.php?superpwa-manifest-$1.json last;
rewrite ^/OneSignalSDKWorker.js.php$ /index.php?OneSignalSDKWorker.js-$1.php last;
rewrite ^/superpwa-sw(-[0-9]+)?.js$ /index.php?superpwa-sw.js last;
Remember:
No NGINX? No cookie? No problem.
SuperPWA generates (or attempts to) two files to convert your WordPress website into a Progressive Web App. You guessed it, the manifest and the service worker.
These files are generated in the root folder of your WordPress install (the same folder where wp-config.php is) during plugin activation.
To generate these files, WordPress needs folder permissions to write to the root folder. In your host however, WordPress couldn’t do it because your web host has limited the permissions on this folder.
Note how I keep saying WordPress needs permissions and not SuperPWA? This is because SuperPWA uses the Filesystem API of WordPress to handle file generation and deletion. So if WordPress can do it, then SuperPWA can do it too.
The ideal way to resolve this, is to contact your web host. Tell them what is happening and maybe even point them to this article. They know your server and they will know what to do.
It is a relatively simple fix and should be a very common support request to your web host and they should be able to help you out in no time.
Once the permissions are adjusted, remember to visit SuperPWA > Settings to check the status.
Hello,
When I contacted WP re this they said it is not possible to write in the root folder as it would jeopardise its security. So I think I am going to delete this plugin.
Anyways thanks and wish you all the best!
Hey there, thanks for checking out SuperPWA!
Sorry to hear your host doesn’t allow that. Simply allowing to write on
superpwa-manifest.json
andsuperpwa-sw.js
would be good enough, in case you want to negotiate with your host. (The filenames will be different if you are using Multisite btw.)In any case, we have plans to move to a setup where this will not be necessary. So maybe you can try again later.
Thanks once again for the kind words!
It would be nice to have the opportunity to create these files inside the plugin or elsewhere and to copy then in the root in a second step.
Starting with SuperPWA 2.0, these files are not written physically and are dynamic instead. Can you upgrade and take a look?
Great plugin. However, I could not see it in action. Both the above files did not install. I think you need to sort this issue out with WordPress.com
Hey Amitesh,
Please upgrade to SuperPWA 2.0 and try again. No more physical files, but dynamic files are used instead.
hello,
The files are not get generated ever after the change in permission can you guide what to put in the file so we can create the file manually and upload to the root folder.
Hey Santosh, please upgrade to SuperPWA 2.0 and try again. In this release, these files are not physically written, but are dynamically generated.
Hi: I just installed your plugin – it’s the second PWA plugin I have tried to install – and I got the message back saying the manifest and service worker could not be generated. I got the same error with the previous plugin.
First off, my permissions are fine – I even changed them to 777, and that didn’t help. However, my gut is telling me that I am having this problem because WordPress on my server is not installed in the domain root, but rather in a subdirectory – e,g., https://domain.com/folder/ . I’m guessing that you guys didn’t figure people do these things…
So then, two questions:
1): Where can I hack your plugin to get this to work?; and
2): If I can’t, could I generate and install the manifest and service worker manually?
My thanks in advance for your time and attention —
Hey James, please upgrade to SuperPWA 2.0 and try again. These files are no longer written physically and that should do the trick.