Closed mrdomino closed 9 months ago
I don't think that's possible to avoid the type module
as we need to use export type
in sw.ts
.
If I configure swc
to use non-module files, it crashes with
× 'import', and 'export' cannot be used outside of module code
╭─[1:1]
1 │ /// <reference lib="WebWorker" />
2 │ export type {};
· ──────
3 │ declare let self: ServiceWorkerGlobalScope;
4 │
5 │ self.addEventListener("install", async () => {
What is the export type
doing?
The export type {};
line is just a placeholder, otherwise Typescript cries
Can I close the issue as the problem seems to have been resolved?
Sure. I would say not planned rather than resolved though.
https://github.com/vercel/next.js/issues/33863#issuecomment-1783841956