[issue] - type of 'browser' is any
hnbnh opened this issue · comments
Ninh Bình commented
Hi, there's a problem with browser
variable, its type should not be any
.
Steps to Reproduce
- Clone the project & install dependencies.
- Run
pnpm dev
. - Content of
src/auto-imports.d.ts
:
declare global {
const browser: typeof import('webextension-polyfill')['default']
// ...
}
- The type of every
browser
variable isany
.
Jani Eväkallio commented
I just ran into the same problem. The webextension-polyfill
package exports a Browser
type, so you can do this:
- const browser: typeof import('webextension-polyfill')['default']
+ const browser: import("webextension-polyfill").Browser;
I'm not sending a PR for this since I'm not sure if this is the correct fix -- unsure why this has broken in the first place, or whether it's never worked correctly in the first place.