Open SpiZeak opened 1 year ago
I just ran into this as well, although I'm using the Astro version: @vite-pwa/astro. I get the following error:
error Unable to write the service worker file. ''
File:
/myproj/node_modules/workbox-build/build/lib/write-sw-using-default-template.js:67:81
Code:
66 | throw new Error(errors_1.errors['sw-write-failure-directory']);
> 67 | }
| ^
68 | throw new Error(`${errors_1.errors['sw-write-failure']} '${err.message}'`);
69 | }
70 | }
Stacktrace:
Error: Unable to write the service worker file. ''
at <anonymous> (/myproj/node_modules/workbox-build/build/lib/write-sw-using-default-template.js:67:81)
at processTicksAndRejections (:55:77)
Same problem here!
I downgraded from bun 1.0.4 to 1.0.3 for the time being. I see bun is currently at 1.0.6. I may try that and report back, in the off chance this was fixed.
Doesn't work for me on Bun 1.0.7
Still not working on Bun version 1.0.9
Same on Bun version 1.0.11
I think it's this bug https://github.com/rollup/plugins/pull/835 which is re-exposed by https://github.com/googlechrome/workbox.
Workaround is to override the dependency in package.json
:
"overrides": {
"@rollup/plugin-node-resolve": "^15.2.3"
}
I think it's this bug rollup/plugins#835 which is re-exposed by https://github.com/googlechrome/workbox.
Workaround is to override the dependency in
package.json
:"overrides": { "@rollup/plugin-node-resolve": "^15.2.3" }
Does that go in our main package.json or in the vite-pwa?
@Natetronn you can put it in your project's package.json
but I'll submit a PR for vite-plugin-pwa as well!
Same error on 1.0.11, although let me delete the lock and node_modules folder and install fresh an report back.
Update:
I deleted bun.lockb and node_modules folder and ran bun install
again and it worked. Thanks @rotu!
I think it's this bug rollup/plugins#835 which is re-exposed by https://github.com/googlechrome/workbox.
Workaround is to override the dependency in
package.json
:"overrides": { "@rollup/plugin-node-resolve": "^15.2.3" }
Fixed it for me thanks
What version of Bun is running?
1.0.4+745b6b94ee56cad24d475799690cc9a89957d15b
What platform is your computer?
Linux 5.15.90.1-microsoft-standard-WSL2 x86_64 x86_64
What steps can reproduce the bug?
bun run --bun vite build
with vite-plugin-pwa in vite.config.jsUnable to write the service worker file. ''
What is the expected behavior?
The build runs without errors
What do you see instead?
Additional information
Running the same command with version 1.0.3 works flawlessly.