Open Yuta0227 opened 1 year ago
Same Problem
@Yuta0227 I can see you're using Laravel 10 and assuming you're on Vite, which compiles the js files under "build" folder under public folder. You're filesToCache
array may look different.
var filesToCache = [
'/',
'/offline',
'/assets/build/app.css', <---
'/assets/build/app.js', <---
'storage/images/icons/icon-72x72.png',
'storage/images/icons/icon-96x96.png',
'storage/images/icons/icon-128x128.png',
'storage/images/icons/icon-144x144.png',
'storage/images/icons/icon-152x152.png',
'storage/images/icons/icon-192x192.png',
'storage/images/icons/icon-384x384.png',
'storage/images/icons/icon-512x512.png',
];
I need help. when I use localhost, serviceworker registration is successful ,but when I deploy it on vercel, it fails. I can access my robots.txt file under public directory, but serviceworker.js file under public directory and /storage/images/icons directory linked to public directory using
php artisan storage:link
cannot be found. I have tried many things by going through other issues on this repository and asking chatgpt. I think using laravel10 might be causing this problem since laravel10 is not included in README. The following is my code.if there are any other files you need to help me out, please give me a reply. serviceworker.jsmeta.blade.php
laravelpwa.php
composer.json