Skip to content

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

Open
@shadow-identity

Description

@shadow-identity

Similar, but not the same as #28781

System info

  • Playwright Version: v.1.41.0
  • Operating System: macOS 14.2.1
  • Browser: All
  • Other 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

  • Make a fresh install of the SvelteKit with Typescript and Playwright support
  • Add src/lib/foo.ts with exported foo function
  • Add src/lib/baz.ts with exported baz function. The baz.ts should import and use foo function
  • Import baz into tests/test.ts and use it inside of the test function call
  • To be sure that it is not the same issue as [BUG] cannot see $lib with sveltekit2 #28781, apply the workaround

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions