wxt: The popup doesn't show anything and right clicking into developer mode shows an error:Error: @vitejs/plugin-react can't detect preamble

Describe the bug

The popup doesn’t show anything and right clicking into developer mode shows an error:

Error: @vitejs/plugin-react can’t detect preamble

snapshots:

Image Image

Reproduction

bunx wxt@latest init

Steps to reproduce

Reproduction step:

1.bunx wxt@latest init 2.cd wxt-demo 3.bun i 4.bun dev (bun -b dev also has the same issue) 5.right click on popup 6.open devtool

System Info

System:
    OS: macOS 15.0
    CPU: (8) arm64 Apple M1
    Memory: 156.33 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    bun: 1.2.5 - ~/.bun/bin/bun
  Browsers:
    Chrome: 135.0.7049.85
    Safari: 18.0
  npmPackages:
    wxt: ^0.20.0 => 0.20.1

Used Package Manager

bun

Validations

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 12
  • Comments: 21 (4 by maintainers)

Most upvoted comments

Wxt released a minor version yesterday. You can downgrade and lock it to 0.20.0 first.

Downgrade version of wxt from "wxt": "^0.20.0" to "wxt": "0.20.0" works.

@Dieber You could take it a try.

Thanks to @Libra-Lei

Yes indeed, the error seems different :

https://i.imgur.com/uZUkUwH.png

However, I haven’t changed anything in the default template Thanks

我看到,wxt 昨天发了一个小版本,可以先降级并锁定 0.20.0

@mengxi-ream Could you try this version for me?

npm i https://pkg.pr.new/wxt@b0f4ac82 b0f4ac8

I’ve confirmed it fixes your reproduction.

This works, thank you @aklinker1 @SimYunSup

The same.

System:
    OS: macOS 15.4
    CPU: (10) arm64 Apple M2 Pro
    Memory: 68.31 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.17.0 - ~/.local/state/fnm_multishells/55644_1744550982290/bin/node
    npm: 10.8.2 - ~/.local/state/fnm_multishells/55644_1744550982290/bin/npm
    pnpm: 10.8.0 - ~/.local/state/fnm_multishells/55644_1744550982290/bin/pnpm
  Browsers:
    Chrome: 135.0.7049.85
    Edge: 135.0.3179.73
    Safari: 18.4
  npmPackages:
    react: ^19.1.0 => 19.1.0
    typescript: ^5.8.3 => 5.8.3
    wxt: ^0.20.0 => 0.20.1

How to reproduce:

1. bunx wxt@latest init
2. cd wxt-demo
3. bun i
4. bun dev (bun -b dev also has the same issue)
5. right click on popup
6. open devtool

Simply replace bun to pnpm

Log:

Failed to load resource: the server responded with a status of 404 (Not Found)

Uncaught Error: @vitejs/plugin-react can't detect preamble. Something is wrong. See https://github.com/vitejs/vite-plugin-react/pull/11#discussion_r430879201 at App.tsx:1:33
Image