You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've encounter an issue when using DI in @adonisjs v6. Cannot inject "[Function: Object]" in "[class IndicesController]". Error occurs even in fresh projects and simplified demos.
importUserfrom'#models/user'importtypeBaseApiServicefrom'#services/base_api_service'import{inject}from'@adonisjs/core'importtype{HttpContext}from'@adonisjs/core/http'
@inject()exportdefaultclassIndicesController{constructor(protectedbaseApiService: BaseApiService){}asyncrespond({}: HttpContext){constuser=awaitUser.all()returnthis.baseApiService.success('Success fetch all user',200,{ user })}}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I've encounter an issue when using DI in @adonisjs v6. Cannot inject "[Function: Object]" in "[class IndicesController]". Error occurs even in fresh projects and simplified demos.
base_api_service.ts
indices_controller.ts
Package version :
+-- @adonisjs/assembler@7.8.2
+-- @adonisjs/auth@9.3.2
+-- @adonisjs/core@6.17.2
+-- @adonisjs/cors@2.2.1
+-- @adonisjs/eslint-config@2.0.0
+-- @adonisjs/lucid@21.6.0
+-- @adonisjs/prettier-config@1.4.4
+-- @adonisjs/tsconfig@1.4.0
+-- @japa/api-client@3.0.3
+-- @japa/assert@4.0.1
+-- @japa/plugin-adonisjs@4.0.0
+-- @japa/runner@4.2.0
+-- @swc/core@1.10.7
+-- @types/luxon@3.4.2
+-- @types/node@22.13.10
+-- @vinejs/vine@3.0.0
+-- eslint@9.22.0
+-- hot-hook@0.4.0
+-- luxon@3.5.0
+-- pg@8.13.3
+-- pino-pretty@13.0.0
+-- prettier@3.5.3
+-- reflect-metadata@0.2.2
+-- ts-node-maintained@10.9.5
`-- typescript@5.7.3
Beta Was this translation helpful? Give feedback.
All reactions