-
Notifications
You must be signed in to change notification settings - Fork 53
Open
Description
When I'm trying to run SDK with the following code:
import * as FusionSDK from "@1inch/fusion-sdk";
console.log(FusionSDK);It gives me the following error:
node ./index.js
node:internal/modules/esm/resolve:275
throw new ERR_MODULE_NOT_FOUND(
^
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/.../node_modules/.pnpm/@[email protected]/node_modules/@1inch/fusion-sdk/dist/esm/fusion-order/index' imported from /Users/.../node_modules/.pnpm/@[email protected]/node_modules/@1inch/fusion-sdk/dist/esm/index.jsMy package.json does contain "type": "module".
Tried on both Node.js latest versions of 20.x and 23.x.
Issue can be resolved if all imports will be as follow:
esm/index.js:
export * from './fusion-order/index';
export * from './amount-calculator/';
export * from './connector/index';
export * from './sdk/index';
export * from './constants';
export * from './utils';
export * from './utils/amounts';
export * from './utils/time';
export * from './validations';
export * from './ws-api';
export * from './errors';will be replaced with:
export * from './fusion-order/index.js';
export * from './amount-calculator/index.js';
export * from './connector/index.js';
export * from './sdk/index.js';
export * from './constants.js';
export * from './utils/amounts.js';
export * from './utils/time.js';
export * from './validations.js';
export * from './ws-api/index.js';
export * from './errors.js';in all files.
e.g. by putting fully specified module paths into all imports of your libraries (including dependent 1inch libraries).
Metadata
Metadata
Assignees
Labels
No labels