Skip to content

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

Merged
patak-cat merged 4 commits into
vitejs:mainfrom
keyding:patch/fix-in-chrome-extension
Apr 3, 2024
Merged

fix: do not access document in /@vite/client when not defined#16318
patak-cat merged 4 commits into
vitejs:mainfrom
keyding:patch/fix-in-chrome-extension

Conversation

@keyding

@keyding keyding commented Mar 31, 2024

Copy link
Copy Markdown
Contributor

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

@bolt-new-by-stackblitz

Copy link
Copy Markdown

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

@sapphi-red sapphi-red left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
Member

/ecosystem-ci run

@vite-ecosystem-ci

Copy link
Copy Markdown

Comment thread packages/vite/src/client/overlay.ts Outdated
Comment thread packages/vite/src/client/overlay.ts Outdated
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