Open CXZ7720 opened 2 years ago
@CXZ7720 try adding workbox-window
as dev dependency
@userquin sorry for confusing, I updated attached image.
@CXZ7720 can you disable the vite compress plugin to check if the problem is using also that plugin?
@userquin It fails same again.
@CXZ7720 can you provide the vite config file?
@userquin Here's my vite.config.ts
/* eslint-disable camelcase */
import react from '@vitejs/plugin-react'
import { defineConfig } from 'vite'
import { VitePWA } from 'vite-plugin-pwa'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react(),
VitePWA(),
],
publicDir: './public',
})
@CXZ7720 weird, try logging the error on write-sw-using-default-template.js
, it seems to be shadowed by workbox-build
(no stacktrace with the cause, maybe you need to add some extra dependency), add a console.error('weird', error)
before line 68
throw new Error(`${errors_1.errors['sw-write-failure']} '${err.message}'`);
@userquin I'm affraid if it is stupid question, How can I edit the line of zipped file on ide?
upps, sorry, I don't check that module is inside a zip... (maybe it is just a name, it is a zip file on your file system?)
Maybe you can debug it, just add a breakpoint on line 68 and check the error
@userquin Yes It is zip file. I can't edit the file.
Hi @CXZ7720 , I had the same problem and I just solved it by updating nodejs to the latest LTS available, 16.15.1
.
My current configuration is:
Yarn 3.2.1(berry, pnp mode enabled)
NodeJS 16.15.1
Vite 2.9.12
vite-plugin-pwa 0.12.0
typescript 4.7.4
Hope it can help you too!
Hi. I have a problem with build in Yarn berry with pnp environment. Here's my Build Environment.
Here's my console error with pnp environment.![image](https://user-images.githubusercontent.com/29659112/171374408-230d8428-9089-4bbf-955d-543d7f7582fd.png)
By the way, I can successfully build at yarn classic(1.23.x) and yarn berry with node-modules linker.
yarn berry with node-modules linker.![image](https://user-images.githubusercontent.com/29659112/171366725-ddc9413f-73a4-46df-853f-6d703adbc2e7.png)
yarn classic![image](https://user-images.githubusercontent.com/29659112/171364110-9d983e57-8f55-4763-99bc-90b6e2001bd8.png)