`import.meta.env.ENTRYPOINT` is `undefined` for the side panel entrypoint
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
- Run
npm installfollowed bynpm run dev - Open the side panel by clicking the extension's action
- 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
- 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
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