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

nacos in ng ssr server.ts not work #126

Open
LauGaHo opened this issue Aug 20, 2024 · 0 comments
Open

nacos in ng ssr server.ts not work #126

LauGaHo opened this issue Aug 20, 2024 · 0 comments

Comments

@LauGaHo
Copy link

LauGaHo commented Aug 20, 2024

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

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