Closed EricHasegawa closed 1 year ago
Hey @EricHasegawa I tried to replicate the error that you are facing but could not do it with the following steps:
var SibApiV3Sdk = require('sib-api-v3-sdk'); var defaultClient = SibApiV3Sdk.ApiClient.instance;
npm install sib-api-v3-sdk --save
{ "name": "testwrappers", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC", "dependencies": {}, "devDependencies": { "sib-api-v3-sdk": "^8.2.0" } }
It looks like the dependencies were not correctly installed.
Can you please try to remove the node_modules
folder and then install the dependencies again?
Do let me know if you face any issues.
Same issue here, I already try installing modules again!
Having this same issue, using yarn to install the package, then importing with import SibAPI from 'sib-api=v3-sdk'
. It builds fine on our API server, but not the client.
The client is being used when I call const defaultClient = SibAPI.ApiClient.instance
This is identical to how it is done on the server.
When building on the client I get
Module not found: Can't resolve 'ApiClient'
null
Error from chokidar (D:\): Error: EBUSY: resource busy or locked, lstat 'D:\DumpStack.log.tmp'
Hey I will work on it and try to reproduce it at our end.
Exact same issue, please look into it.
Hey!
webpack
in your project please consider adding it to the config file linkIf you are still facing the issue after webpack
config change please send me steps so that I can replicate it and help you better. By the time I will take a look again and share if I find anything useful.
Thanks
Yeah, we are having the same issue as well, causing pretty big problems for our users. May need to go with another provider if this isn't fixable soon.
Hi @RupertDunmil
Had we been able to replicate the issue on our side we would have already fixed it. But unfortunately, we haven't been able to.
It would be great if you can tell us what scenario you are using this package in. I would like to understand the use case for the sole purpose of replicating it on our side.
If you don't feel secure enough to share the details here, you can email me at shubham.upadhyay@sendinblue.com. I will try my best to fix it.
Others as well (@ShyamKatti, @RegisDahma, @IrfDev, @EricHasegawa) can share with me the use case on my email so that I can test in multiple scenarios to replicate it.
Thanks!
Thank you for reporting this issue. However, I would request you to please report this issue with our support team from you account (https://account.sendinblue.com/support --> please create a new ticket) as it might require further investigation and we will look into it. It will be better than sending it via email to me.
Please mention these details in the ticket:
Hey
I tried to again replicate the same error on my local machine. But, no luck I could still run it. The configuration/versions I am testing on:
OS: macOS 11.2.1 NodeJS: 14.15.4 NPM: 7.15.1 sib-api-v3-sdk: 8.2.0
Please check out the attached screenshot from my laptop. Could you please confirm if it is coming from a specific route or in all of them?
Thanks!
Having issue relating to this
Module not found: Error: Can't resolve 'model/UploadImageToGallery' in 'C:\xampp\htdocs\project\node_modules\sib-api-v3-sdk\src'
Did you mean './model/UploadImageToGallery'?
Requests that should resolve in the current directory need to start with './'.
Requests that start with a name are treated as module requests and resolve within module directories (node_modules).
If changing the source code is not an option there is also a resolve options called 'preferRelative' which tries to resolve these kind of requests in the current directory too.
Hi @worldtok I will check this today.
Hi @worldtok I will check this today.
Any update?
HI @yaron1m Unfortunately, I haven't been able to replicate this issue at our end. Can you help us with steps on how to replicate it or how you are trying to use it? Also, FYI we are using the latest version of this wrapper inside SIB internal projects and it is working fine. Thanks!
I invested some time in trying to make this work and gave up. I am now just using fetch
with a POST request
same issue, am running node 16.14.2 and npm 8.5.5 on windows
Same issue on MacOS (M1) 12.4 , Node 16.14.2 Gave up and used something else instead.
I could solve this issue by adding this to the webpack config:
module: { rules: [ ... { test: /\.js$/, parser: { amd: false, }, }, ], },
Same issue here. Is there an official fix?
Same issue, how do I this this?
The official fix seems to be "please patch your whole build process to spit CJS modules" (which you might not want to do your codebase is somewhat modern).
Using the fetch API with the right headers instead is definitely more effective (see link).
Based on style, I'm pretty sure the authors of the library thought "java" in javascript stood for Java the language.
Want a PR on how to expose a lib for multiple modules systems ?
Having problems on this too. Any guidance?
closing because its been a couple years lol
This is a perfect example of how you lose customers.
Hi @laubonghaudoi Sorry to hear we could not help you with this. The reason is that we were not able to reproduce this issue in any way we tried.
We do have our new SDKs mainly with the replacement of api.sendinblue.com
domain with api.brevo.com
domain. If you want you can try them out as here:
Any fix till now? Started facing the error as soon as I upgraded to next js 13.4. Worked fine before that
Same issue on a modern nextjs environment server-side.
I will have to consider shifting to a different service entirely since our workflow is supposed to heavily rely on the API integration 😢 It's unfortunate because it was definitely our favourite option so far.
Seems like this issue persists for those using nextjs 13.4
On Thu, 13 Jul 2023, 06:09 Gustavo Giserman, @.***> wrote:
Same issue on a modern nextjs environment server-side.
I will have to consider shifting to a different service entirely since our workflow is supposed to heavily rely on the API integration 😢 It's unfortunate because it was definitely our favourite option so far.
— Reply to this email directly, view it on GitHub https://github.com/sendinblue/APIv3-nodejs-library/issues/101#issuecomment-1633392800, or unsubscribe https://github.com/notifications/unsubscribe-auth/A5DSV4ZBBX7WP72MMUAHYX3XP5DFVANCNFSM43RPIBWQ . You are receiving this because you commented.Message ID: @.***>
Having success replacing sdk with fetch and hitting the endpoints directly. Not a huge problem but I wish I didn't have to rewrite all sdk methods 😆
Maybe the documentation should also point out the api-key header must go in the Api-Key
custom header. Unless its discouraged to implement it this way?
Can you please send the code. I am really stuck and cant figure a way out.
On Thu, 13 Jul 2023, 06:32 Gustavo Giserman, @.***> wrote:
Having success replacing sdk with fetch and hitting the endpoints directly. Not a huge problem but I wish I didn't have to rewrite all sdk methods 😆
Maybe the documentation should also point out the api-key header must go in the Api-Key custom header. Unless its discouraged to implement it this way?
— Reply to this email directly, view it on GitHub https://github.com/sendinblue/APIv3-nodejs-library/issues/101#issuecomment-1633407247, or unsubscribe https://github.com/notifications/unsubscribe-auth/A5DSV4YDC2GEIEEF3NAD6WTXP5F4JANCNFSM43RPIBWQ . You are receiving this because you commented.Message ID: @.***>
Can you please send the code. I am really stuck and cant figure a way out.
@hassan34319 here is an example of a contact creation request. hope it helps.
Based on https://developers.brevo.com/reference/createcontact
const request = await fetch('https://api.brevo.com/v3/contacts', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Api-Key': process.env.BREVO_API_KEY,
},
body: JSON.stringify({
email: 'email@example.com',
listIds: [2], // use your own list ids...
attributes: {
SOMETHING: 'something',
},
}),
})
if (request.ok) // success
else // failed
Importing import * as SibApiV3Sdk from @.***/client' is also working.
On Thu, Jul 13, 2023 at 7:29 AM Gustavo Giserman @.***> wrote:
Can you please send the code. I am really stuck and cant figure a way out.
@hassan34319 https://github.com/hassan34319 here is an example of a contact creation request. hope it helps.
Based on https://developers.brevo.com/reference/createcontact
const request = await fetch('https://api.brevo.com/v3/contacts', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Api-Key': process.env.BREVO_API_KEY, }, body: JSON.stringify({ email, listIds: [2], // use your own list ids... attributes: { SOMETHING: 'something', }, }),}) if (request.ok) // successelse // failed
— Reply to this email directly, view it on GitHub https://github.com/sendinblue/APIv3-nodejs-library/issues/101#issuecomment-1633448153, or unsubscribe https://github.com/notifications/unsubscribe-auth/A5DSV42BLS2MI54XEKCJTKLXP5MQ5ANCNFSM43RPIBWQ . You are receiving this because you were mentioned.Message ID: @.***>
FIx with nextjs 13.4 is using this library instead : https://github.com/sendinblue/APIv3-typescript-library/tree/main
On Thu, Jul 13, 2023 at 8:07 AM Hassan Iqbal @.***> wrote:
Importing import * as SibApiV3Sdk from @.***/client' is also working.
On Thu, Jul 13, 2023 at 7:29 AM Gustavo Giserman @.***> wrote:
Can you please send the code. I am really stuck and cant figure a way out.
@hassan34319 https://github.com/hassan34319 here is an example of a contact creation request. hope it helps.
Based on https://developers.brevo.com/reference/createcontact
const request = await fetch('https://api.brevo.com/v3/contacts', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Api-Key': process.env.BREVO_API_KEY, }, body: JSON.stringify({ email, listIds: [2], // use your own list ids... attributes: { SOMETHING: 'something', }, }),}) if (request.ok) // successelse // failed
— Reply to this email directly, view it on GitHub https://github.com/sendinblue/APIv3-nodejs-library/issues/101#issuecomment-1633448153, or unsubscribe https://github.com/notifications/unsubscribe-auth/A5DSV42BLS2MI54XEKCJTKLXP5MQ5ANCNFSM43RPIBWQ . You are receiving this because you were mentioned.Message ID: @.***>
Same module resolution issue. Seems to not work with NextJS 14's native api routes. All you have to do is spin up a new NextJS project (14), and follow NextJS documentation while trying to load the library, whether its
import SibApiV3Sdk from "sib-api-v3-sdk";
or
const SibApiV3Sdk = require("sib-api-v3-sdk");
It does work however if I'm in a less abstracted node environment. That being said, the former should work and is an expected standard.
Following the basic instructions, after running
npm install sib-api-v3-sdk --save
and then pasting in `var SibApiV3Sdk = require('sib-api-v3-sdk');var defaultClient = SibApiV3Sdk.ApiClient.instance;` I get the error mentioned in the title. It seems to me like this is an error within the API, but I could also be doing something wrong. Does anyone have any suggestions?