Replies: 2 comments 4 replies
-
Typescript does not know about the IOC-Bindings at compile time (because they are evaluated at runtime). Therefore you have to create a types declaration file for your custom service like so: contracts/WhateverNameYouWant.d.ts declare module "@ioc:Elastic" {
import { Client as ElasticClient } from "@elastic/elasticsearch"
declare const elasticClient: ElasticClient
export default elasticClient
} Under the hood (in their corresponding packages) Adonis does exactly that for built-in providers. |
Beta Was this translation helpful? Give feedback.
-
in my case, here's the full config: |
Beta Was this translation helpful? Give feedback.
-
This is probably something easy to solve but I can't figure out why TypeScript keep saying this when I import my custom provider:
Here is my custom provider:
Beta Was this translation helpful? Give feedback.
All reactions