Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: do not access document in /@vite/client when not defined #16318

Merged
merged 4 commits into from Apr 3, 2024

Conversation

keyding
Copy link
Contributor

@keyding keyding commented Mar 31, 2024

Description

When using the vite-plugin-web-extension plugin for chrome extension development, the background requests http:/ /localhost:5173/@vite/client, background does not exist document.

overlay.ts

client.ts

Copy link

stackblitz bot commented Mar 31, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@sapphi-red sapphi-red linked an issue Apr 3, 2024 that may be closed by this pull request
7 tasks
@sapphi-red sapphi-red added p3-minor-bug An edge case that only affects very specific usage (priority) regression The issue only appears after a new release labels Apr 3, 2024
@sapphi-red sapphi-red changed the title fix: document not in background of chrome extension fix: do not access document in /@vite/client when not defined Apr 3, 2024
sapphi-red
sapphi-red previously approved these changes Apr 3, 2024
Copy link
Member

@sapphi-red sapphi-red left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a test and confirmed this fixes #16277

@sapphi-red
Copy link
Member

/ecosystem-ci run

@patak-dev patak-dev enabled auto-merge (squash) April 3, 2024 12:33
@patak-dev patak-dev merged commit 646319c into vitejs:main Apr 3, 2024
10 checks passed
@keyding keyding deleted the patch/fix-in-chrome-extension branch April 3, 2024 13:22
patak-dev pushed a commit that referenced this pull request Apr 5, 2024
Co-authored-by: sapphi-red <49056869+sapphi-red@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p3-minor-bug An edge case that only affects very specific usage (priority) regression The issue only appears after a new release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Uncaught ReferenceError: document is not defined
3 participants