Improved error message when entrypoint loading fails
Open
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
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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