Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in DdcClientConfig #263

Open
sgerodes opened this issue Aug 5, 2024 · 0 comments
Open

Error in DdcClientConfig #263

sgerodes opened this issue Aug 5, 2024 · 0 comments

Comments

@sgerodes
Copy link

sgerodes commented Aug 5, 2024

Attempting to configure DdcClientConfig and use StorageNodeMode results in TypeScript and module resolution errors.

Steps to Reproduce

import {DdcClientConfig} from "@cere-ddc-sdk/ddc-client/src/DdcClient";

export const MY_NET: DdcClientConfig = {
    "blockchain": 'ws://127.0.0.1:9944/ws',
    "logLevel": "info",
    "nodes": [
        {
            "mode": "Full",
            "grpcUrl": "grpc://127.0.0.1:9091",
            "httpUrl": "http://127.0.0.1:8081"
        }
    ]
};

result in the error

TS2322: Type "Full" is not assignable to type StorageNodeMode
StorageNode.d.ts(11, 5): The expected type comes from property mode which is declared here on type RouterNode

Switching to the enum type yield an error too.

import {DdcClientConfig} from "@cere-ddc-sdk/ddc-client/src/DdcClient";
import {StorageNodeMode} from "@cere-ddc-sdk/blockchain/src/types";
export const MY_NET_2: DdcClientConfig = {
    "blockchain": 'ws://127.0.0.1:9944/ws',
    "logLevel": "info",
    "nodes": [
        {
            "mode": StorageNodeMode.Full,
            "grpcUrl": "grpc://127.0.0.1:9091",
            "httpUrl": "http://127.0.0.1:8081"
        }
    ]
};
Error: Package subpath './src/types' is not defined by "exports" in .../node_modules/@cere-ddc-sdk/blockchain/package.json

Current workaround - ignoring typescript checks

export const LOCAL_G6_NET: DdcClientConfig = {
    // Other configurations...
    "nodes": [
        {
            // @ts-ignore
            "mode": "Full",
            // Other properties...
        }
    ]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant