Type 'MyProvider' is not assignable to type 'ISmsProvider'
This might be a little winded but go with me here
I'm creating a new SMS provider to allow an enterprise SNPP connection. (more on that in the PR) - anyways, when creating the
customSnpp.handler.ts
file, and assigning this.provider = new CustomSnppSmsProvider(config);
I'm getting an error that states Type 'CustomSnppSmsProvider' is not assignable to type 'ISmsProvider'
, however everything is set up properly. If I do this.provider = new CustomSnppSmsProvider(config) as any;
, the project compiles and runs but I don't like do the any
claim in typescript.
Here is a snipping of the Provider:
and here is a snipping of the handler:
thoughts?25 Replies
@Support @Moderator Please have a look
Could you send the import part of the handler file?
yessir, one sec
and for the customSnpp.handler file as well
@dr.really, you just advanced to level 4!
@dr.really have you tried to restart TS server, because the code looks ok to me 🙂
@paweltymczuk, you just advanced to level 8!
let me try that
nope that didn't work 😦
this is the full stack trace that it's dumping, for some reason it's not liking the
sendMessage
function lolin the logs I see that the
@novu/stateless
version that you use is 0.4.1
can you switch to the 0.9.0
?woooow i'm dumb lol
let me fix that
that's the default version that comes from
yarn run generate:provider
just fyiplease create a ticket for that 😉
For anyone interested, change the version of @Novu/stateless inside this file 😉
_templates/provider/new/package.ejs.t
let me build this out and i can pop in a PR for that if you guys are busy
it will be cool, if you can create the PR for it 😄
side note: updating that fixed my issues lol
let's close this one then 😉
so i just noticed, that when I make this PR my local branch is going to push up the outlook365 provider which i have a open PR that's ready for merging ( i think ) anyway we can get that merged before I make this PR so it doesn't do crazy git things? lol
pr in question: https://github.com/novuhq/novu/pull/2052
you can commit your changes for outlook365 in your outlook branch,
then switch to the
next
branch and pull the latest changes and create a new branch to address this issue
and then later go back to outlook branch to continue working on itsooo that's where I messed up at first, I did that in my local next branch 😬 granted in the future I'm doing things like you stated lol (apologies for being difficult)
GitHub
chore: Updated stateless package to 0.9.0 by cryptic-ai · Pull Requ...
What change does this PR introduce?
Bump the version of @novu/stateless to 0.9.0
Why was this change needed?
When using the generate:provider feature, it was placing the wrong stateless version in ...
@dr.really, you just advanced to level 6!