self.__WB_MANIFEST is undefined when the strategies is 'injectManifest'
eRendon opened this issue · comments
Hi!,
I have a problem when deploy the proyecto to vercel or any host and previw server in local.
Versión PWA plugin vite
"vite-plugin-pwa": "^0.11.13",
Versión vite
"vite": "^2.6.7",
Version vue
"vue": "^3.0.5",
The configuration of mi custom sw
the configuration of vite plugin
When build the proyect, the error is
and in the self instance, not see __WB_MANIFEST
and the structure of my proyect
i don´t know why not inyected the manifest context in the window context...
Thanks for your help
@eRendon try to upgrade vue version to 3.2
, if you cannot upgrade the vue version try adding this line at the top of your sw.ts
file:
/// <reference lib="webworker" />
@userquin now my dependences are
i upgrade vue version. Builded whit sourcemap, i see the problem in the PrecachingControll.js file
add to the /// <reference lib="webworker"/>
from the sw file
@eRendon what are you doing importing the src/sw.ts
from your src/main.ts
module? you cannot import the sw
on the main entry, you should remove that import from that module, registerSW
call will register the sw.
I test your repo (https://github.com/eRendon/vite-vue3-tailwind) using pnpm
instead npm
and it is working on my local, you will need:
- remove
workbox-precaching
from dependencies and add it as dev dependency - add
workbox-window
as dev dependency - remove
import './sw';
from yourmain.ts
(line 21)
Thanks!!!!! maybe the problem are the workbox-window
as dev dependencie and other libraries that i have in dependencies.
The sw importe in the main, is to practice whit the update component registration and notification.
Thanks so much. The problem is solved.