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: prevent error overlay style being overridden (fixes #9969) #9971

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 20 additions & 9 deletions packages/vite/src/client/overlay.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
import type { ErrorPayload } from 'types/hmrPayload'

// set :host styles to make playwright detect the element as visible
Copy link
Member Author

@sapphi-red sapphi-red Sep 3, 2022

Choose a reason for hiding this comment

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

Another way is to set { state: 'attached' } but that still might break ecosystem tests that relies on this.

const template = /*html*/ `
<style>
:host {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.backdrop {
position: fixed;
z-index: 99999;
top: 0;
Expand Down Expand Up @@ -99,15 +108,17 @@ code {
cursor: pointer;
}
</style>
<div class="window">
<pre class="message"><span class="plugin"></span><span class="message-body"></span></pre>
<pre class="file"></pre>
<pre class="frame"></pre>
<pre class="stack"></pre>
<div class="tip">
Click outside or fix the code to dismiss.<br>
You can also disable this overlay by setting
<code>server.hmr.overlay</code> to <code>false</code> in <code>vite.config.js.</code>
<div class="backdrop">
<div class="window">
<pre class="message"><span class="plugin"></span><span class="message-body"></span></pre>
<pre class="file"></pre>
<pre class="frame"></pre>
<pre class="stack"></pre>
<div class="tip">
Click outside or fix the code to dismiss.<br>
You can also disable this overlay by setting
<code>server.hmr.overlay</code> to <code>false</code> in <code>vite.config.js.</code>
</div>
</div>
</div>
`
Expand Down