Getting sub-module from extension constructor not working.
Closed this issue · 6 comments
This line in example extension raises error:
this.fee = this.tatumSdkContainer.get(FeeEvm)
Exec of example 'app' returns this:
/home/kutuk/WebstormProjects/ecosystem-addons-master/examples/app/node_modules/src/container-instance.class.ts:75 throw new ServiceNotFoundError(identifier); ^ ServiceNotFoundError: Service with "MaybeConstructable<FeeEvm>" identifier was not found in the container. Register it before usage via explicitly calling the "Container.set" function or using the "@Service()" decorator. at ContainerInstance.get (/home/kutuk/WebstormProjects/ecosystem-addons-master/examples/app/node_modules/src/container-instance.class.ts:75:11) at TatumSdkContainer.get (/home/kutuk/WebstormProjects/ecosystem-addons-master/examples/app/node_modules/@tatumio/tatum/src/service/extensions/tatumsdk.container.ts:16:39) at new ConfigurableExtension (/home/kutuk/WebstormProjects/ecosystem-addons-master/examples/configurable-extension/src/configurable.extension.ts:9:39) at Function.addExtension (/home/kutuk/WebstormProjects/ecosystem-addons-master/examples/app/node_modules/@tatumio/tatum/src/service/tatum/tatum.ts:250:22) at Function.configureExtensions (/home/kutuk/WebstormProjects/ecosystem-addons-master/examples/app/node_modules/@tatumio/tatum/src/service/tatum/tatum.ts:230:18) at Function.init (/home/kutuk/WebstormProjects/ecosystem-addons-master/examples/app/node_modules/@tatumio/tatum/src/service/tatum/tatum.ts:218:16) at processTicksAndRejections (node:internal/process/task_queues:95:5) at async run (/home/kutuk/WebstormProjects/ecosystem-addons-master/examples/app/src/index.ts:6:22) { normalizedIdentifier: 'MaybeConstructable<FeeEvm>' } error Command failed with exit code 1.
Tried getting another sub-module (EvmRpc
) in another use case (react app) - almost same result
ServiceNotFoundError at new ServiceNotFoundError (service-not-found.error.ts:20:1) at ContainerInstance.get (container-instance.class.ts:75:1) at TatumSdkContainer.get (tatumsdk.container.ts:16:1) at new WalletConnectExtension (walletconnect.extension.ts:28:1) at TatumSDK.addExtension (tatum.ts:265:1) at TatumSDK.configureExtensions (tatum.ts:249:1) at TatumSDK.init (tatum.ts:233:1) at async signIn (App.tsx:38:1)
Can you describe step by step what are you doing?
- Download https://github.com/tatumio/ecosystem-addons
- Extract
- Go to configurable-extension folder.
- npm install & npm run build
- Go to app folder
- In src/index.ts commented lines with hello-world extension - so only configurable-extension left in app
- In app's package.json removed 2 dependencies:
"@tatumio/hello-world": "path_to_local.tgz",
"@tatumio/configurable-extension": "path_to_local.tgz",
to use them locally later - In app folder: npm install
- npm link ../configurable-extension - to use extension folder as package
- Manually add dependency to app's package.json
"@tatumio/configurable-extension": "v1.0.2", - npm run example
- Got error: throw new ServiceNotFoundError(identifier);
Same happens to me when using npm link, there must be some miss-config, I'll look into that. Meanwhile using pack
and linking .tgz manually works just fine.