Skip to content

Commit a110e81

Browse files
authored
fix: make sure wrapper is found before accessing the classList (#225)
When used with https://github.com/pmmmwh/react-refresh-webpack-plugin this error shows up during incremental builds. ```Cannot read property 'classList' of null```
1 parent cc0de77 commit a110e81

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/client/overlays/progress-minimal.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ const init = (options, socket) => {
9595
const percent = Math.floor(data.percent * 100);
9696
const wrapper = document.querySelector(`#${ns}`);
9797

98-
wrapper.classList.remove(`${ns}-hidden`, `${ns}-disappear`);
98+
if (wrapper) {
99+
wrapper.classList.remove(`${ns}-hidden`, `${ns}-disappear`);
100+
}
99101

100102
if (data.percent === 1) {
101103
if (document.hidden) {

0 commit comments

Comments
 (0)