nacos-sdk-nodejs
nacos-sdk-nodejs copied to clipboard
nacos in ng ssr server.ts not work
my ng project use nacos, I write it in the server.ts, through webpack , it found that error
error msg as followed:
Unhandled Promise rejection: _this3._client.getConfigs is not a function ; Zone: <root> ; Task: Promise.then ; Value: TypeError: _this3._client.getConfigs is not a function
at /Users/Documents/my-framework/dist/apps/my-app/server/main.js:256766:35
at Generator.next (<anonymous>)
at asyncGeneratorStep (/Users/Documents/my-framework/dist/apps/my-app/server/main.js:364731:24)
at _next (/Users/Documents/my-framework/dist/apps/my-app/server/main.js:364750:9)
at /Users/Documents/my-framework/dist/apps/my-app/server/main.js:364755:7
at new ZoneAwarePromise (/Users/Documents/my-framework/dist/apps/my-app/server/main.js:361963:23)
at /Users/Documents/my-framework/dist/apps/my-app/server/main.js:364747:12
at NacosConfigClient.getConfigs (/Users/Documents/my-framework/dist/apps/my-app/server/main.js:256767:7)
at 2747 (/Users/Documents/my-framework/dist/apps/my-app/server/main.js:363281:14)
at __webpack_require__ (/Users/Documents/my-framework/dist/apps/my-app/server/main.js:528907:42) TypeError: _this3._client.getConfigs is not a function
at /Users/Documents/my-framework/dist/apps/my-app/server/main.js:256766:35
at Generator.next (<anonymous>)
at asyncGeneratorStep (/Users/Documents/my-framework/dist/apps/my-app/server/main.js:364731:24)
at _next (/Users/Documents/my-framework/dist/apps/my-app/server/main.js:364750:9)
at /Users/Documents/my-framework/dist/apps/my-app/server/main.js:364755:7
at new ZoneAwarePromise (/Users/Documents/my-framework/dist/apps/my-app/server/main.js:361963:23)
at /Users/Documents/my-framework/dist/apps/my-app/server/main.js:364747:12
at NacosConfigClient.getConfigs (/Users/Documents/my-framework/dist/apps/my-app/server/main.js:256767:7)
my code as followed:
const configClient = new NacosConfigClient({
serverAddr: 'xxxxxxxxxxx:443',
namespace: 'xxxxxxxxx',
username: 'xxxxxx',
ssl: true,
password: 'xxxxxx'
});
const content = configClient.getConfig('xxx', 'xxxxxx').then((res) => {
});
pls help me thanks