microsoft / playwright

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
https://playwright.dev
Apache License 2.0
67.13k stars 3.69k forks source link

[BUG] Error when $lib imported from $lib with sveltekit 2 #29049

Open shadow-identity opened 10 months ago

shadow-identity commented 10 months ago

Similar, but not the same as https://github.com/microsoft/playwright/issues/28781

System info

Source code

https://github.com/shadow-identity/sk2-playwright-repro [We will only be able to work on the issues that we can reproduce.]

[Please provide a self-contained example in a form of a snippet, archive or a repository.]

[Repro scenario can't be large or have external dependencies.]

Steps

Expected

Tests are passed, "foo" is printed in the console.

Actual

Tests fails with this output

> playwright test

[WebServer] "confetti" is imported from external module "@neoconfetti/svelte" but never used in "src/routes/sverdle/+page.svelte".
Error: Cannot find package '$lib' imported from /Users/pnedrigailov/my/tmp/sk2/src/lib/baz.ts

Error: No tests found

 ELIFECYCLE  Command failed with exit code 1.
sand4rt commented 10 months ago

Related to: https://github.com/microsoft/playwright/issues/18825