jsr-io / jsr

The open-source package registry for modern JavaScript and TypeScript
https://jsr.io
MIT License
2.53k stars 118 forks source link

`<reference lib="webworker" />` results in `bannedTripleSlashDirectives` error during publish #836

Open HuakunShen opened 1 week ago

HuakunShen commented 1 week ago

I am getting typescript error with web worker APIs.

TS2339 [ERROR]: Property 'postMessage' does not exist on type 'Window & typeof globalThis'.
                self.postMessage(data)
                     ~~~~~~~~~~~

The solution I found that works is adding /// <reference lib="webworker" /> to the top of the file, but this will cause bannedTripleSlashDirectives error during jsr publish