You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We've encountered an issue when trying to use the self-sdk library with ES6 module syntax (import). The library works well with CommonJS syntax (require), but it throws an error when using import:
TypeError: Cannotreadpropertiesofundefined(reading'build')Toimprovethelibrary's compatibility with various JavaScript environments, it would be great if the exports could be updated to support both CommonJS and ES6 modules.
Here's a suggestion for updating the exports in the library:
// Assuming you have something like this in your libraryconstSelfSDK={build: ()=>{// Your logic here},};// Add the following linesexportdefaultSelfSDK;// ES6 default exportmodule.exports=SelfSDK;// CommonJS export
Additionally, please ensure that the TypeScript configuration file (tsconfig.json) includes the following compiler options:
We've encountered an issue when trying to use the
self-sdk
library with ES6 module syntax (import). The library works well with CommonJS syntax (require), but it throws an error when using import:Here's a suggestion for updating the exports in the library:
Additionally, please ensure that the TypeScript configuration file (tsconfig.json) includes the following compiler options:
These options allow TypeScript to generate code that can interoperate between CommonJS and ES6 modules.
By making these changes, users will be able to use both
const SelfSDK = require("self-sdk");
andimport SelfSDK from 'self-sdk';
without issues.The text was updated successfully, but these errors were encountered: