Open coderpr0grammer opened 1 month ago
Hey, unfortunately I wrote this wrapper with ESM-only projects in mind, since IMO it's a much cleaner syntax and a more modern way of doing things.
If you want to change your project to use ES modules, you can configure your tsconfig.json
something like this:
/* @see [TSConfig Documentation](https://www.typescriptlang.org/tsconfig) */
{
"compilerOptions": {
/* Type checking. */
"strict": true,
/* Modules. */
"module": "ESNext",
"moduleResolution": "Bundler",
/* Interop constraints. */
"esModuleInterop": true,
"isolatedModules": true,
"verbatimModuleSyntax": true,
/* Language and environment. */
"lib": ["dom", "dom.iterable", "ESNext"],
"moduleDetection": "force",
"target": "ESNext"
}
}
This will likely break a lot of things. If you don't want to change your bundler setup, you can just copy/paste the source code into your project to use. It's pretty simple, just a wrapper around the Sendblue API. I don't use or maintain this at the moment so that's about as much help as I can give.
Best of luck.
When trying to import in my typescript file that gets compiled to commonjs:
I get the following error:
Error [ERR_REQUIRE_ESM]: require() of ES Module @rileybarabash/sendblue-ts/dist/index.js from /functions/lib/index.js not supported.
I have also tried dynamic import:
But I get the same error.
tsconfig.json: