fix: Use HMR API for dev server communication #3114
Annotations
3 errors
Run pnpm test:
packages/wxt/e2e/tests/output-structure.test.ts#L277
Error: Snapshot `Output Directory Structure > should generate ESM background script when type=module 1` mismatched
- Expected
+ Received
@@ -1,24 +1,19 @@
".output/chrome-mv3/background.js
----------------------------------------
- var _a, _b;
import { l as logHello, i as initPlugins } from "./chunks/_virtual_wxt-plugins-OjKtWpmY.js";
+ import "http://localhost:3000/@id/wxt/background-client";
function defineBackground(arg) {
if (arg == null || typeof arg === "function") return { main: arg };
return arg;
}
const definition = defineBackground({
type: "module",
main() {
logHello("background");
}
});
- // @ts-expect-error
- ((_b = (_a = globalThis.browser) == null ? void 0 : _a.runtime) == null ? void 0 : _b.id) == null ? globalThis.chrome : (
- // @ts-expect-error
- globalThis.browser
- );
function print(method, ...args) {
return;
}
const logger = {
debug: (...args) => print(console.debug, ...args),
❯ e2e/tests/output-structure.test.ts:277:8
|
Run pnpm test:
packages/wxt/e2e/tests/output-structure.test.ts#L362
Error: Snapshot `Output Directory Structure > should generate IIFE background script when type=undefined 1` mismatched
- Expected
+ Received
@@ -1,10 +1,9 @@
".output/chrome-mv3/background.js
----------------------------------------
var background = function() {
"use strict";
- var _a, _b;
function defineBackground(arg) {
if (arg == null || typeof arg === "function") return { main: arg };
return arg;
}
function logHello(name) {
@@ -17,15 +16,10 @@
}
});
background;
function initPlugins() {
}
- // @ts-expect-error
- ((_b = (_a = globalThis.browser) == null ? void 0 : _a.runtime) == null ? void 0 : _b.id) == null ? globalThis.chrome : (
- // @ts-expect-error
- globalThis.browser
- );
function print(method, ...args) {
return;
}
const logger = {
debug: (...args) => print(console.debug, ...args),
❯ e2e/tests/output-structure.test.ts:362:8
|
Run pnpm test
Process completed with exit code 1.
|
Loading