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

Issue "@azure/web-pubsub": "^1.1.3", #31573

Closed
tusharsurjuse opened this issue Oct 29, 2024 · 7 comments
Closed

Issue "@azure/web-pubsub": "^1.1.3", #31573

tusharsurjuse opened this issue Oct 29, 2024 · 7 comments
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-author-feedback Workflow: More information is needed from author to address the issue. no-recent-activity There has been no recent activity on this issue. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that WebPubSub

Comments

@tusharsurjuse
Copy link

An error occurred: TypeError: Right-hand side of 'instanceof' is not an object
at push.66071.module.exports [as sign] (sign.js:114:57)
at Object.sendRequest (webPubSubCredentialPolicy.js:17:33)
at pipeline.js:51:31
at generatedClient.js:65:24
at Generator.next ()
at asyncGeneratorStep (asyncToGenerator.js:3:1)
at _next (asyncToGenerator.js:17:1)
at asyncToGenerator.js:22:1
at new ZoneAwarePromise (zone.js:2702:25)
at asyncToGenerator.js:14:1

@tusharsurjuse tusharsurjuse changed the title Issue "@azure/web-pubsub": "^1.1.1", Issue "@azure/web-pubsub": "^1.1.3", Oct 29, 2024
@github-actions github-actions bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Oct 29, 2024
@jeremymeng
Copy link
Member

@tusharsurjuse thanks for reporting the issue. If possible could you please share a simplified project that reproduces this?

It looks like the error is thrown from jsonwebtoken.sign, where it expects KeyObject from crypto. Are you running your app in an environment other than NodeJS?

https://github.com/auth0/node-jsonwebtoken/blob/bc28861f1fa981ed9c009e29c044a19760a0b128/sign.js#L114

@jeremymeng jeremymeng added WebPubSub Client This issue points to a problem in the data-plane of the library. labels Oct 29, 2024
@github-actions github-actions bot removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Oct 29, 2024
@tusharsurjuse
Copy link
Author

tusharsurjuse commented Nov 25, 2024

I am using @azure/web-pubsub with angular application version 18
its works great with @azure/web-pubsub": "^1.1.1
but when i updated to @azure/web-pubsub": "^1.1.3 then showing this error

getting error while making connection

const serviceClient = new WebPubSubServiceClient(connectionString(), hub());
let token = await serviceClient.getClientAccessToken({ userId: user_id });

//this demo application code

import { Component } from '@angular/core';
import { RouterOutlet } from '@angular/router';
import { WebPubSubServiceClient } from '@azure/web-pubsub';

@component({
selector: 'app-root',
standalone: true,
imports: [RouterOutlet],
templateUrl: './app.component.html',
styleUrl: './app.component.scss'
})
export class AppComponent {
title = 'testapp';

constructor(){
}

ngOnInit() {
this.dashboardSettingPublishNotification();
}

async dashboardSettingPublishNotification() {
const cs='connection_string'
const hub = 'hub';
const serviceClient = new WebPubSubServiceClient(cs, hub);
let user_id:string = 'wsstxuygjk';
await serviceClient.sendToUser(user_id, {action:'action_setting_changes'});
}

}

it will be great if you added sample application to work with angular like added for JavaScript and react

@jeremymeng
Copy link
Member

Other than bumping our required NodeJS version to v18, I don't see any obvious changes that could be related to this between v1.1.1 and v1.1.3. @vicancy please take a look.

@vicancy
Copy link
Member

vicancy commented Nov 26, 2024

Is AngualrJS running in the browser? I don't think @azure/web-pubsub is targeting for browser usage, it is for backend applications. It is also not safe to have connection string loaded in the browser.

@xirzec
Copy link
Member

xirzec commented Nov 26, 2024

Good point @vicancy ! @tusharsurjuse I think the package you mean to be using is @azure/web-pubsub-client https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/web-pubsub/web-pubsub-client

@xirzec xirzec added the needs-author-feedback Workflow: More information is needed from author to address the issue. label Nov 26, 2024
Copy link

Hi @tusharsurjuse. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.

Copy link

github-actions bot commented Dec 3, 2024

Hi @tusharsurjuse, we're sending this friendly reminder because we haven't heard back from you in 7 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

@github-actions github-actions bot added the no-recent-activity There has been no recent activity on this issue. label Dec 3, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-author-feedback Workflow: More information is needed from author to address the issue. no-recent-activity There has been no recent activity on this issue. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that WebPubSub
Projects
None yet
Development

No branches or pull requests

4 participants