Skip to content

Commit 8c3f7ab

Browse files
authored
Merge pull request #593 from preactjs/debug-warning
2 parents b0c0d23 + 17131b7 commit 8c3f7ab

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

.changeset/eleven-beers-lay.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@prefresh/vite': patch
3+
'@prefresh/webpack': patch
4+
---
5+
6+
Convey information when an update fails

packages/vite/src/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ module.exports = function prefreshPlugin(options = {}) {
1010
return {
1111
name: 'prefresh',
1212
configResolved(config) {
13-
shouldSkip = config.isProduction || config.command === 'build' || config.server.hmr === false;
13+
shouldSkip =
14+
config.isProduction ||
15+
config.command === 'build' ||
16+
config.server.hmr === false;
1417
},
1518
async transform(code, id, options) {
1619
const ssr =
@@ -91,6 +94,7 @@ module.exports = function prefreshPlugin(options = {}) {
9194
try {
9295
flushUpdates();
9396
} catch (e) {
97+
console.log('[PREFRESH] Failed to flush updates:', e);
9498
self.location.reload();
9599
}
96100
});

packages/webpack/src/loader/runtime.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ module.exports = function () {
4141
if (moduleHot.invalidate) {
4242
moduleHot.invalidate();
4343
} else {
44+
console.log('[PREFRESH] Failed to flush updates:', e);
4445
self.location.reload();
4546
}
4647
}

0 commit comments

Comments
 (0)