notifme / notifme-sdk

A Node.js library to send all kinds of transactional notifications.
https://notifme.github.io/www/
MIT License
1.94k stars 150 forks source link

Error require in Sailjs 1.x #73

Closed hung211097 closed 3 years ago

hung211097 commented 4 years ago

Hi, I used this package for notification feature but when I tried to require const NotifmeSdk = require("notifme-sdk").default; and called new NotifmeSdk({}), I cannot lift the sailjs app. I got this error {"code":"include-all:COULD_NOT_REQUIRE","raw":{},"filepath":"/home/nguyenhung/Documents/Git/notifier/api/controllers/noti/async.js","level":"error","message":"Failed to lift app:","severity":"error"}. I think the reason is es6 syntax. How can I resolve this? Thank you.

BDav24 commented 4 years ago

Hi, I'm not sure es6 syntax is the problem here. If you can make a minimal repo and describe the steps to reproduce the error I can try to look into it when I have the time.

hung211097 commented 3 years ago

Hi @BDav24, I got the problem when I added the custom channels "socket" in the constructor params. I use notifme-sdk ver 1.10.0 and sails ver 1.4.0

hung211097 commented 3 years ago

I solved the problem when I added the multiProviderStrategy: 'fallback' in custom channels, thank you