w3cj / express-api-starter-ts

A basic starter for an express.js API with Typescript
MIT License
394 stars 126 forks source link

Error when using path aliases in typescript #8

Open codeAbinash opened 2 months ago

codeAbinash commented 2 months ago

Cannot find module '@utils/utils' Require stack:

{
   "compilerOptions": {
      "lib": ["es2020"],
      "typeRoots": ["node_modules/@types"],
      "allowSyntheticDefaultImports": true,
      "experimentalDecorators": true,
      "emitDecoratorMetadata": true,
      "moduleResolution": "node",
      "pretty": true,
      "declaration": true,
      "allowJs": true,
      "noEmit": false,
      "resolveJsonModule": true,
      "importHelpers": true,
      "baseUrl": ".",
      "outDir": "dist",
      "sourceMap": true,
      "target": "esnext",
      "module": "commonjs",
      "esModuleInterop": true,
      "forceConsistentCasingInFileNames": true,
      "noImplicitAny": true,
      "strict": true,
      "skipLibCheck": true,
      "paths": {
         "@/*": ["*"],
         "@utils/*": ["utils/*"]
      }
   },
   "exclude": ["node_modules", "dist"]
}

image

Dabrox02 commented 1 month ago

Only change @utils/utils to @/utils/utils