adonisjs / auth

Official Authentication package for AdonisJS
https://docs.adonisjs.com/guides/auth/introduction
MIT License
191 stars 65 forks source link

Cannot find type definition file for '@adonis/auth' #189

Closed on3ss closed 2 years ago

on3ss commented 2 years ago

I am getting an error in the tsconfig.json file after installing this package.

[{
    "resource": "/d:/Oness/Projects/ScriptsCode/hotel-mgmt/hotel-api/tsconfig.json",
    "owner": "typescript",
    "severity": 8,
    "message": "Cannot find type definition file for '@adonisjs/auth'.\n  The file is in the program because:\n    Entry point of type library '@adonisjs/auth' specified in compilerOptions",
    "source": "ts",
    "startLineNumber": 1,
    "startColumn": 1,
    "endLineNumber": 1,
    "endColumn": 2
}]

Package version

"@adonisjs/auth": "^8.0.10",

Node.js and npm version

Node: v16.13.2
NPM: 8.1.2

Sample Code (to reproduce the issue)

tsconfig.json

{
  "extends": "./node_modules/adonis-preset-ts/tsconfig",
  "include": [
    "**/*"
  ],
  "exclude": [
    "node_modules",
    "build"
  ],
  "compilerOptions": {
    "outDir": "build",
    "rootDir": "./",
    "sourceMap": true,
    "paths": {
      "App/*": [
        "./app/*"
      ],
      "Config/*": [
        "./config/*"
      ],
      "Contracts/*": [
        "./contracts/*"
      ],
      "Database/*": [
        "./database/*"
      ]
    },
    "types": [
      "@adonisjs/core",
      "@adonisjs/repl",
      "@adonisjs/lucid",
      "@adonisjs/auth"
    ]
  }
}

BONUS (a sample repo to reproduce the issue)

Project Repo

on3ss commented 2 years ago

I just had to delete node_modules and the .lock file and rerun yarn install and it works