Error: Cannot find module

Hi, While running test in cirlce CI I am facing this issue.

Error: Cannot find module '@pages/CreateCertificatePage'
Require stack:
- /root/project/tests/certificationPublishAndUnpublish.test.ts
- /root/project/node_modules/@playwright/test/lib/loader.js
- /root/project/node_modules/@playwright/test/lib/runner.js
- /root/project/node_modules/@playwright/test/lib/cli.js
- /root/project/node_modules/playwright-core/lib/cli/cli.js
- /root/project/node_modules/playwright-core/cli.js
- /root/project/node_modules/@playwright/test/cli.js

   at tests/certificationPublishAndUnpublish.test.ts:4

  2 | import CommonActions from "@pages/CommonActions";
  3 | import ContentPage from "@pages/ContentPage";
> 4 | import CreateCertificatePage from "@pages/CreateCertificatePage";
    | ^
  5 | import { test, expect } from "@playwright/test";
  6 | import * as data from "@test-data/create_certificate.json"
  7 |

TSConfig file

    "compilerOptions": {
        "strictNullChecks": false,
        "target": "ES2015",
        "strict": true,
        "module": "CommonJS",
        "sourceMap": false,
        "resolveJsonModule": true,
        "baseUrl": ".",
        "rootDir": "./",
        "paths": {
            "@pages/*": [
            "@env/*": [
            "@files/*": [
            "@selectors/*": [
            "@test-data/*": [
            "@base/*": [

All the configurations are correct, but still facing the issue.
ContentPage & other class files are within the same directory, one class is working whereas other class is not working.
Please help.


version: 2
      - image:
      NODE_ENV: development # Needed if playwright is in `devDependencies`
      - checkout
      - run:
          name: Install the devDependencies
          command: npm install
      - run:
          name: Execute the tests
          command: |
            npm run test:staging-national
      - store_test_results:
          path: results.xml


export default class CreateCertificatePage {
 // few methods here

Did you get any solution on the above as I am also facing the same issue

Yes, actually it is because of Git case sensitivity in the file name.

my class file is like commonAction.ts and CommonAction.ts.
So I have delete the duplicate file and then it worked.

You can use the “ls” command to check the file names in the pipeline

Issue resolved for me as well after renaming , btw i followed your content to learn playwright . It was very helpful . You may mention this in ur videos as well .