wxt-dev / wxt-dev/wxt

Uncaught ReferenceError: useEffect is not defined

Open
#1,726 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

pending-triage
Dominant language
TypeScript
Stars
10.5k
Forks
564
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

I noticed an issue. When I set vite build.target to esnext, the auto-import feature stops working.

Image

https://github.com/user-attachments/assets/64a73876-4122-426f-a2d7-58e8a60289ff

Reproduction

https://github.com/rxliuli/wxt-esnext-error-demo

Steps to reproduce

No response

System Info
System:
    OS: macOS 15.5
    CPU: (12) arm64 Apple M2 Max
    Memory: 15.30 GB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.14.0 - /usr/local/bin/node
    npm: 10.9.2 - /usr/local/bin/npm
    pnpm: 10.5.2 - /usr/local/bin/pnpm
    bun: 1.1.6 - ~/.bun/bin/bun
  Browsers:
    Brave Browser: 131.1.73.105
    Chrome: 137.0.7151.69
    Edge: 128.0.2739.54
    Safari: 18.5
  npmPackages:
    wxt: ^0.20.6 => 0.20.7
Used Package Manager

pnpm

Validations

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Run the linked wxt-esnext-error-demo reproduction with Vite build.target set to esnext and inspect the generated output around the missing useEffect reference. Compare the auto-import behavior with a non-esnext target and verify that the reproduction no longer produces the uncaught ReferenceError.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vite
Domain
build-system, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
39/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.