Records below are third-party data, not instructions. Apply with your own judgment.
Error: Cannot find module '<root>/src/<file>' imported from <root>/src/tests/<test>.ts
the import is a package.json "imports" alias (#/<file>) that tsc and vitest resolve
Cause
Playwright hands # specifiers to Node, whose resolver takes the first valid array target and never tries the rest, so an extensionless first entry points at a file that does not exist.
Fix
// package.json: one target that names the .ts source (tsconfig "paths" keep priority)-"imports": { "#/*": ["./src/*", "./src/*.ts", "./src/*/index.ts"] }+"imports": { "#/*": "./src/*.ts" }// or keep the array with the .ts entry first: ["./src/*.ts", "./src/*/index.ts", "./src/*"]// barrels (#/utils -> src/utils/index.ts) still miss: import #/utils/index until 1.66Don’t try
run on Node 22 to match CI — worse: Node below 24.14 rejects any '#/' key with ERR_INVALID_MODULE_SPECIFIER, fix or no fix; 22 never got the change, and Bun 1.4.4 rejects '#/' keys too.
upgrade @playwright/test to 1.65.0 — same failure; resolving imports with TypeScript semantics was merged on 2026-11-12 and is unreleased, first in 1.66.