SvelteKitError: Not found: /_vercel/insights/script.js with playwright/test
shinokada opened this issue · 2 comments
shinokada commented
I use the following to SvelteKit:
import { inject } from '@vercel/analytics';
inject();
When I run pnpm test:integration
that runs playwright test
, the test passes but outputs the following:
1 test.ts:3:1 › index page has expected h1
[WebServer] SvelteKitError: Not found: /_vercel/insights/script.js
at resolve2 (file:///Users/shinichiokada/Svelte/SVELTE-ICON-FAMILY/svelte-awesome-icons/.svelte-kit/output/server/index.js:3603:18)
at resolve (file:///Users/shinichiokada/Svelte/SVELTE-ICON-FAMILY/svelte-awesome-icons/.svelte-kit/output/server/index.js:3435:34)
at #options.hooks.handle (file:///Users/shinichiokada/Svelte/SVELTE-ICON-FAMILY/sve
✓ 1 test.ts:3:1 › index page has expected h1 (1.1s)
at respond (file:///Users/shinichiokada/Svelte/SVELTE-ICON-FAMILY/svelte-awesome-icons/.svelte-kit/output/server/index.js:3433:43)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
status: 404,
text: 'Not Found'
}
I tried the following, but the results are the same:
import { dev } from '$app/environment';
import { inject } from '@vercel/analytics';
inject({ mode: dev ? 'development' : 'production' });
System info
System:
OS: macOS 14.4
CPU: (10) arm64 Apple M2 Pro
Memory: 81.28 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.10.0 - ~/.nvm/versions/node/v20.10.0/bin/node
npm: 10.2.4 - ~/.nvm/versions/node/v20.10.0/bin/npm
pnpm: 8.15.4 - /opt/homebrew/bin/pnpm
bun: 1.0.13 - ~/.bun/bin/bun
Browsers:
Chrome: 122.0.6261.129
Edge: 122.0.2365.92
Safari: 17.4
npmPackages:
@sveltejs/adapter-auto: ^3.1.1 => 3.1.1
@sveltejs/kit: ^2.5.4 => 2.5.4
@sveltejs/package: ^2.3.0 => 2.3.0
@sveltejs/vite-plugin-svelte: ^3.0.2 => 3.0.2
svelte: ^4.2.12 => 4.2.12
vite: ^5.1.6 => 5.1.6