diff --git a/.changeset/gentle-bulldogs-heal.md b/.changeset/gentle-bulldogs-heal.md new file mode 100644 index 000000000000..32c1d6714c43 --- /dev/null +++ b/.changeset/gentle-bulldogs-heal.md @@ -0,0 +1,5 @@ +--- +'svelte': patch +--- + +fix: upgrade to esm-env 1.2.1 to fix issues with non-Vite setups diff --git a/packages/svelte/package.json b/packages/svelte/package.json index 6b3970c7f9e8..cd61ce2e8874 100644 --- a/packages/svelte/package.json +++ b/packages/svelte/package.json @@ -142,7 +142,7 @@ "acorn-typescript": "^1.4.13", "aria-query": "^5.3.1", "axobject-query": "^4.1.0", - "esm-env": "^1.2.0", + "esm-env": "^1.2.1", "esrap": "^1.2.3", "is-reference": "^3.0.3", "locate-character": "^3.0.0", diff --git a/packages/svelte/tests/runtime-browser/test.ts b/packages/svelte/tests/runtime-browser/test.ts index 1b97988fdaf7..582a10edf722 100644 --- a/packages/svelte/tests/runtime-browser/test.ts +++ b/packages/svelte/tests/runtime-browser/test.ts @@ -79,6 +79,7 @@ async function run_test( __CONFIG__: path.resolve(test_dir, '_config.js'), 'assert.js': assert_file }, + conditions: ['browser', 'production'], plugins: [ { name: 'testing-runtime-browser', @@ -131,6 +132,7 @@ async function run_test( __MAIN_DOT_SVELTE__: path.resolve(test_dir, 'main.svelte'), __CONFIG__: path.resolve(test_dir, '_config.js') }, + conditions: ['browser', 'production'], plugins: [ { name: 'testing-runtime-browser-ssr', @@ -191,9 +193,11 @@ async function run_test( try { const page = await browser.newPage(); - page.on('console', (type) => { + page.on('console', (message) => { + let method = message.type(); + if (method === 'warning') method = 'warn'; // @ts-ignore - console[type.type()](type.text()); + console[method](message.text()); }); if (build_result_ssr) { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bc431a4096ec..b604c59f20c6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -81,8 +81,8 @@ importers: specifier: ^4.1.0 version: 4.1.0 esm-env: - specifier: ^1.2.0 - version: 1.2.0 + specifier: ^1.2.1 + version: 1.2.1 esrap: specifier: ^1.2.3 version: 1.2.3 @@ -224,7 +224,7 @@ importers: version: 6.0.1(@lezer/common@1.2.1) esm-env: specifier: ^1.0.0 - version: 1.2.0 + version: 1.2.1 marked: specifier: ^7.0.2 version: 7.0.5 @@ -1442,8 +1442,8 @@ packages: jiti: optional: true - esm-env@1.2.0: - resolution: {integrity: sha512-OhSQuHL3mUcaQHjGe8UMG8GsJIJHYYz0flR0h9fiTPNMupLMkb7TvcRD0EeJXW5a8GHBgfz08b6FDLNK7kkPQA==} + esm-env@1.2.1: + resolution: {integrity: sha512-U9JedYYjCnadUlXk7e1Kr+aENQhtUaoaV9+gZm1T8LC/YBAPJx3NSPIAurFOC0U5vrdSevnUJS2/wUVxGwPhng==} espree@10.1.0: resolution: {integrity: sha512-M1M6CpiE6ffoigIOWYO9UDP8TMUw9kqb21tf+08IgDYjCsOvCuDt4jQcZmoYxx+w7zlKw9/N0KXfto+I8/FrXA==} @@ -3519,7 +3519,7 @@ snapshots: '@types/cookie': 0.6.0 cookie: 0.6.0 devalue: 5.1.1 - esm-env: 1.2.0 + esm-env: 1.2.1 import-meta-resolve: 4.1.0 kleur: 4.1.5 magic-string: 0.30.11 @@ -3534,7 +3534,7 @@ snapshots: '@sveltejs/site-kit@6.0.0-next.64(@sveltejs/kit@2.8.3(@sveltejs/vite-plugin-svelte@4.0.0-next.6(svelte@packages+svelte)(vite@5.4.6(@types/node@20.12.7)(lightningcss@1.23.0)(sass@1.70.0)(terser@5.27.0)))(svelte@packages+svelte)(vite@5.4.6(@types/node@20.12.7)(lightningcss@1.23.0)(sass@1.70.0)(terser@5.27.0)))(svelte@packages+svelte)': dependencies: '@sveltejs/kit': 2.8.3(@sveltejs/vite-plugin-svelte@4.0.0-next.6(svelte@packages+svelte)(vite@5.4.6(@types/node@20.12.7)(lightningcss@1.23.0)(sass@1.70.0)(terser@5.27.0)))(svelte@packages+svelte)(vite@5.4.6(@types/node@20.12.7)(lightningcss@1.23.0)(sass@1.70.0)(terser@5.27.0)) - esm-env: 1.2.0 + esm-env: 1.2.1 svelte: link:packages/svelte svelte-persisted-store: 0.9.2(svelte@packages+svelte) @@ -4182,7 +4182,7 @@ snapshots: transitivePeerDependencies: - supports-color - esm-env@1.2.0: {} + esm-env@1.2.1: {} espree@10.1.0: dependencies: