wxt-dev / wxt-dev/wxt

`import.meta.env.ENTRYPOINT` is `undefined` for the side panel entrypoint

Open
#1,611 2 comments 2 reactions 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

Like the title suggests, import.meta.env.ENTRYPOINT is undefined for the side panel entrypoint, when I was expecting it to be set to "sidepanel".

Ideally, import.meta.env.ENTRYPOINT should never be undefined and instead always be set to the current entrypoint's name, even for unlisted entrypoints. For example, even in scripts run in entrypoints/some-unlisted-entrypoint/... I'd expect it to be set to "some-unlisted-entrypoint".

Reproduction

wxt-env-entrypoint-sidepanel-repro.zip

Steps to reproduce
  1. Run npm install followed by npm run dev
  2. Open the side panel by clicking the extension's action
  3. Inspect side panel logs
System Info
System:
  OS: macOS 15.4.1
  CPU: (12) arm64 Apple M2 Pro
  Memory: 112.61 MB / 32.00 GB
  Shell: 5.9 - /bin/zsh
Binaries:
  Node: 22.14.0 - ~/.nvm/versions/node/v22.14.0/bin/node
  npm: 11.3.0 - ~/.nvm/versions/node/v22.14.0/bin/npm
  pnpm: 10.7.0 - ~/.nvm/versions/node/v22.14.0/bin/pnpm
Browsers:
  Chrome: 135.0.7049.97
  Safari: 18.4
Used Package Manager

npm

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

Start with the attached reproduction by running npm install and npm run dev, then inspect the side panel logs and the build handling for import.meta.env.ENTRYPOINT. Done means the side panel reports "sidepanel" and unlisted entrypoint directories receive their own entrypoint name instead of undefined.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.