SvelteKitError: Not found: /_vercel/insights/script.js with playwright/test

Open
#138 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
40/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
playwright, typescript
Domain
testing, web-dev

Research direction

Start by running pnpm test:integration and inspect the integration test at test.ts:3:1 together with the @vercel/analytics injection shown in the report. Trace the request to /_vercel/insights/script.js; done means the Playwright test still passes without the SvelteKit 404 output.

Written by the indexing model from the issue text.

Description

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 
Dominant language
TypeScript
Stars
515
Forks
52
Avg merge
1h 16m
Merged PRs (30d)
2

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from vercel/analytics

All issues in vercel/analytics

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.