wxt-dev / wxt-dev/wxt

Improved error message when entrypoint loading fails

Open
#1,056 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug
const EXAMPLE = new MutationObserver();

export default defineContentScript({ ... });

I believe this is the most common question I get asked. Just need a better error message when the error include "Xyz is not defined", and point to this URL: https://wxt.dev/guide/go-further/entrypoint-loaders.html

Reproduction
const EXAMPLE = new MutationObserver();

export default defineContentScript({ ... });
Steps to reproduce
wxt prepare
System Info
System:
    OS: macOS 14.2.1
    CPU: (8) arm64 Apple M1 Pro
    Memory: 1.86 GB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.20.3 - ~/.asdf/installs/nodejs/18.20.3/bin/node
    Yarn: 1.22.22 - ~/.asdf/installs/nodejs/18.20.3/bin/yarn
    npm: 10.7.0 - ~/.asdf/plugins/nodejs/shims/npm
    pnpm: 9.12.0 - ~/.asdf/installs/nodejs/18.20.3/bin/pnpm
    bun: 1.1.27 - ~/.bunv/bin/bun
  Browsers:
    Chrome: 129.0.6668.90
    Safari: 17.2.1
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

Reproduce the failure with the TypeScript example by running wxt prepare, then trace the entrypoint-loading error described in the issue. The change is done when an undefined-global error produces a clearer message and links to the entrypoint loaders guide.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.