cannot find module export in docker

I’m running a docker application. One of my containers is running node + express + typescript and I face weird issue. I have a file that exports type and file that imports it. In my idee (vs code) there is no such error.
error: SyntaxError: The requested module ‘./account.js’ does not provide an export named ‘Account’

account.ts

export type Account = {
  accountID?: string;
  name: string;
  description?: string;
  balance?: number;
  userID?: string;
};

index.ts

import { Cashflow } from "./cashflow.js";
import { Account } from "./account.js";
import { Goal } from "./goal.js";
import { createAccountAttrSchema } from "./createAccountAttrSchema.js";
import { updateAccountAttrSchema } from "./updateAccountAttrSchema.js";
import { createCashflowAttrSchema } from "./createCashflowAttrSchema.js";
import { updateCashflowAttrSchema } from "./updateCashflowAttrSchema.js";
import { createGoalAttrSchema } from "./createGoalAttrSchema.js";
import { updateGoalAttrSchema } from "./updateGoalAttrSchema.js";

export {
  Cashflow,
  Account,
  Goal,
  createAccountAttrSchema,
  updateAccountAttrSchema,
  createCashflowAttrSchema,
  updateCashflowAttrSchema,
  createGoalAttrSchema,
  updateGoalAttrSchema,
}

compose.yaml (look at the rest-api service)

services:
  rest-api:
    build: ./rest-api
    env_file: ./rest-api/.env
    volumes:
      # better dev experience
      - ./rest-api:/app/
      # to prevent dependencies errors
      - rest-api_nm:/app/node_modules
    ports:
      - 3000:3000
    depends_on:
      # waits until db is ready
      database:
        condition: service_healthy
        restart: true
      # waits until keycloak is ready
      keycloak:
        condition: service_healthy
        restart: true
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:3000/"]
      interval: 10s
      retries: 5
      start_period: 30s
      timeout: 10s
  frontend:
    build: ./frontend
    env_file: ./frontend/.env
    volumes:
      # better dev experience
      - ./frontend:/app/
      # to prevent dependencies errors
      - frontend_nm:/app/node_modules
    ports:
      - 4000:5173
    depends_on:
      rest-api:
        condition: service_healthy
        restart: true
  database:
    build: ./database
    env_file: ./database/.env
    volumes:
      # for persisting db data
      - db-data:/var/lib/postgresql/data
      # file with initial sql queries
      - ./database/init.sql:/usr/share/init.sql
    # checks if db is ready for connections
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
      interval: 10s
      retries: 5
      start_period: 30s
      timeout: 10s
  keycloak:
    build: ./keycloak
    env_file: ./keycloak/.env
    volumes:
      # for importing keycloak realm on startup
      - ./keycloak/import:/opt/keycloak/data/import
      # for storing keycloak data
      - keycloak-data:/opt/keycloak/data
    ports:
      - 5000:8080
    depends_on:
      # waits until db is ready
      database:
        condition: service_healthy
    # checks if keycloak http server is running
    healthcheck:
      test: timeout 10s bash -c ':> /dev/tcp/localhost/8080'
      interval: 10s
      timeout: 10s
      retries: 5
      start_period: 60s
volumes:
  rest-api_nm:
  frontend_nm:
  db-data:
  keycloak-data:

Docker file for rest-api service

FROM node:22-alpine

RUN apk add curl

WORKDIR /app

COPY package*.json ./

RUN npm install

COPY . .

CMD ["npm", "run", "dev"]

package.json

{
  "name": "rest-api",
  "version": "1.0.0",
  "description": "rest api for expens",
  "main": "index.js",
  "type": "module",
  "scripts": {
    "build": "tsc",
    "start": "NODE_ENV=production node dist/index.js",
    "dev": "NODE_ENV=development tsx watch src/index.ts --clear-screen=true"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/LoRd123545/expens.git"
  },
  "author": "Kamil Abbasi",
  "license": "ISC",
  "bugs": {
    "url": "https://github.com/LoRd123545/expens/issues"
  },
  "homepage": "https://github.com/LoRd123545/expens#readme",
  "devDependencies": {
    "@types/express": "^4.17.21",
    "@types/jsonwebtoken": "^9.0.6",
    "@types/pg": "^8.11.6",
    "tsx": "^4.16.0",
    "typescript": "^5.5.2"
  },
  "dependencies": {
    "ajv": "^8.17.1",
    "express": "^4.19.2",
    "jsonwebtoken": "^9.0.2",
    "pg": "^8.12.0",
    "sequelize": "^6.37.3"
  }
}

tsconfig.json

{
  "compilerOptions": {
    "target": "ESNext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
    "module": "NodeNext", /* Specify what module code is generated. */
    "rootDir": "./src", /* Specify the root folder within your source files. */
    "moduleResolution": "NodeNext", /* Specify how TypeScript looks up a file from a given module specifier. */
    "sourceMap": true, /* Create source map files for emitted JavaScript files. */
    "outDir": "dist", /* Specify an output folder for all emitted files. */
    "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
    "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
    "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
    "strict": true, /* Enable all strict type-checking options. */
    "skipLibCheck": true,
    "baseUrl": ".",
    "paths": {
      "src/*": ["src/*"],
      "@utils/*": ["src/utils/*"],
      "@config/*": ["src/config/*"],
      "@middleware/*": ["src/middleware/*"],
      "@controllers/*": ["src/controllers/*"],
      "@routes/*": ["src/routes/*"],
      "@models/*": ["src/models/*"],
      "@services/*": ["src/services/*"],
      "@schemas/*": ["src/schemas/*"],
    },
    "typeRoots": [
      "@types", "./node_modules/@types"
    ]
  },
  "exclude": [
    "node_modules",
    "./*.ts",
    "__test__"
  ],
  "include": [
    "src/**/*"
  ]
}

I tried reinstalling node_modules, restarting app a few times.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật