Skip to content

background.ts not loaded properly #1434

Answered by aklinker1
mderazon asked this question in Q&A
Discussion options

You must be logged in to vote

entrypoints/background/background.ts is not the correct filepath for a background script. Rename the file to entrypoints/background/index.ts.

Allowed filenames are listed here: https://wxt.dev/guide/essentials/entrypoints.html#background

Also mentioned on that page:

An entrypoint can be defined as a single file or directory with an index file inside it.

https://wxt.dev/guide/essentials/entrypoints.html#adding-entrypoints

To go into more depth about how WXT works: if you build for production, you would notice that your extension doesn't have a background script at all. During development, if WXT doesn't find a background script, it adds one with the basic code required for reloading wh…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mderazon
Comment options

Answer selected by mderazon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants