wxt
wxt copied to clipboard
`browser` is not defined in svelte
Describe the bug
'browser' is not defined svelte(missing-declaration)
The above message appears when using browser inside a svelte file.
Reproduction
Steps to reproduce
pnpm dlx wxt@latest init .
> choose svelte
> choose pnpm
open .\src\entrypoints\popup\App.svelte
add {browser.runtime.id} to Line 5
pnpm i
pnpm dev
System Info
System:
OS: Windows 11 10.0.22631
CPU: (12) x64 12th Gen Intel(R) Core(TM) i5-12400F
Memory: 17.64 GB / 31.86 GB
Binaries:
Node: 18.18.2 - C:\Program Files\nodejs\node.EXE
npm: 10.7.0 - ~\AppData\Roaming\npm\npm.CMD
pnpm: 9.7.0 - ~\AppData\Local\pnpm\pnpm.CMD
Browsers:
Edge: Chromium (127.0.2651.74)
Internet Explorer: 11.0.22621.3527
Used Package Manager
pnpm
Validations
- [X] Read the Contributing Guidelines.
- [X] Read the docs.
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- [X] The provided reproduction is a minimal reproducible example of the bug.