TS2792
Cannot find module '@playwright/test'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?
Broken Code ❌
import { PlaywrightTestConfig } from '@playwright/test';
const config: PlaywrightTestConfig = {
use: {
baseURL: 'https://my-staging-environment.com/',
},
};
export default config;{
"compilerOptions": {
"moduleResolution": "classic"
}
}Fixed Code ✔️
To fix the problem you have to use "moduleResolution": "node" in your TS config:
{
"compilerOptions": {
"moduleResolution": "node"
}
}