Closed zgosalvez closed 6 years ago
@zgosalvez This looks like an ES6 / CommonJS interop issue since we're now using TypeScript on our end to compile the package. Can you pass esModuleInterop in your tsconfig.json
?
{
"compilerOptions": {
"lib": ["es2017"],
"module": "commonjs",
"noImplicitReturns": true,
"outDir": "lib",
"sourceMap": true,
"target": "es6",
"esModuleInterop": true
},
"compileOnSave": true,
"include": [
"src"
],
"strictNullChecks": true
}
Afterwards, go ahead and use:
import Taxjar from 'taxjar';
Updated the README authentication example to address this issue.
Thanks, @fastdivision . That did it, tho I had to modify how I imported other dependencies.
Is there a fix for this that doesn't require esModuleInterop
? That creates a bunch of other issues in the app I'm working on.
Hmm I guess it wasn't actually that hard to fix those other issues. So nevermind :)
Is there a fix for this that doesn't require esModuleInterop? That creates a bunch of other issues in the app I'm working on.
We'd like to use this module, however we aren't in a position to refactor the rest of our imports to use the esModuleInterop
compiler flag. Is there another way to use this module?
This used to work on v1, now it throws an error on v2.
Attempting to import as documented throws a different error.
Here's my
tsconfig.json
file.