Cannot find module 'App/Middleware/Auth' or its corresponding type declarations.ts(2307) #3761
-
IDE gives error like this but works fine. Server.middleware.registerNamed({
auth: () => import('App/Middleware/Auth'),
}) I am using pnpm, adonisJS 5, node 16.13 package.json {
"name": "adonisapi",
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "node ace serve --watch",
"build": "node ace build --production",
"start": "node server.js",
"lint": "eslint . --ext=.ts",
"format": "prettier --write ."
},
"eslintConfig": {
"extends": [
"plugin:adonis/typescriptApp",
"prettier"
],
"plugins": [
"prettier"
]
},
"eslintIgnore": [
"build"
],
"prettier": {
"trailingComma": "es5",
"semi": false,
"singleQuote": true,
"useTabs": false,
"quoteProps": "consistent",
"bracketSpacing": true,
"arrowParens": "always",
"printWidth": 100
},
"devDependencies": {
"@adonisjs/assembler": "^5.7.0",
"@japa/preset-adonis": "^1.1.0",
"@japa/runner": "^2.0.9",
"@types/ws": "^8.5.3",
"adonis-preset-ts": "^2.1.0",
"eslint": "^8.17.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-adonis": "^2.1.0",
"eslint-plugin-prettier": "^4.0.0",
"pino-pretty": "^8.0.0",
"prettier": "^2.7.0",
"typescript": "~4.6",
"youch": "^3.2.0",
"youch-terminal": "^2.1.4"
},
"dependencies": {
"@adonisjs/auth": "^8.2.1",
"@adonisjs/core": "^5.8.3",
"@adonisjs/lucid": "^18.0.1",
"@adonisjs/repl": "^3.1.11",
"@types/socket.io": "^3.0.2",
"luxon": "^2.4.0",
"pg": "^8.7.3",
"proxy-addr": "^2.0.7",
"reflect-metadata": "^0.1.13",
"socket.io": "^4.5.1",
"source-map-support": "^0.5.21",
"ws": "^8.8.0"
}
} |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 4 replies
-
Usually going to be one of two things
|
Beta Was this translation helpful? Give feedback.
-
I have same issue with a custom middleware (using Adonis docs to create and register it as named mw). Using pnpm 7.13.4, latest adonis, node 16.13.2, WebStorm 2022.2.3. |
Beta Was this translation helpful? Give feedback.
-
I have the same issue with pnpm. |
Beta Was this translation helpful? Give feedback.
-
I have the same issue using pnpm |
Beta Was this translation helpful? Give feedback.
-
This worked for me #3878 (comment) |
Beta Was this translation helpful? Give feedback.
This worked for me #3878 (comment)