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
-
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/[email protected]
+-- @adonisjs/[email protected]
+-- @adonisjs/[email protected]
+-- @adonisjs/[email protected]
+-- @adonisjs/[email protected]
+-- @adonisjs/[email protected]
+-- @adonisjs/[email protected]
+-- @adonisjs/[email protected]
+-- @japa/[email protected]
+-- @japa/[email protected]
+-- @japa/[email protected]
+-- @japa/[email protected]
+-- @swc/[email protected]
+-- @types/[email protected]
+-- @types/[email protected]
+-- @vinejs/[email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
`-- [email protected]
Beta Was this translation helpful? Give feedback.
All reactions