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

Bad resource ID using web-push (Node.js) #19002

Closed
Tracked by #18455
MiguelRipoll23 opened this issue May 5, 2023 · 4 comments · Fixed by #20280
Closed
Tracked by #18455

Bad resource ID using web-push (Node.js) #19002

MiguelRipoll23 opened this issue May 5, 2023 · 4 comments · Fixed by #20280
Assignees
Labels
bug Something isn't working correctly node compat

Comments

@MiguelRipoll23
Copy link

Hello,

I'm getting the following error when I call the sendNotification function from the npm:web-push@3.6.1 module
May be related to the ongoing work on #18455

BadResource: Bad resource ID
    at Cipheriv.final (ext:deno_node/internal/crypto/cipher.ts:33:13)
    at encryptRecord (file:///C:/Users/migue/AppData/Local/deno/npm/registry.npmjs.org/http_ece/1.1.0/ece.js:423:7)
    at Object.encrypt (file:///C:/Users/migue/AppData/Local/deno/npm/registry.npmjs.org/http_ece/1.1.0/ece.js:509:17)
    at Object.encrypt (file:///C:/Users/migue/AppData/Local/deno/npm/registry.npmjs.org/web-push/3.6.1/src/encryption-helper.js:46:26)
    at Object.WebPushLib.generateRequestDetails (file:///C:/Users/migue/AppData/Local/deno/npm/registry.npmjs.org/web-push/3.6.1/src/web-push-lib.js:244:10)
    at Object.WebPushLib.sendNotification (file:///C:/Users/migue/AppData/Local/deno/npm/registry.npmjs.org/web-push/3.6.1/src/web-push-lib.js:341:29)
    at sendNotification (file:///C:/Users/migue/Documents/GitHub/pusher/services/push_service.ts:142:19)     
    at sendPush (file:///C:/Users/migue/Documents/GitHub/pusher/services/push_service.ts:115:11)
    at eventLoopTick (ext:core/01_core.js:181:11)
    at async Server.#respond (https://deno.land/std@0.185.0/http/server.ts:299:18) {
  name: "BadResource"
}

Thank you.

@bartlomieju
Copy link
Member

@MiguelRipoll23 any chance if you could verify if this is still a problem?

@MiguelRipoll23
Copy link
Author

@bartlomieju yup, unfortunately, still happening in v1.36.0.

BadResource: Bad resource ID
at Cipheriv.final (ext:deno_node/internal/crypto/cipher.ts:35:13)
at encryptRecord (file:///home/codespace/.cache/deno/npm/registry.npmjs.org/http_ece/1.1.0/ece.js:423:7)
at Object.encrypt (file:///home/codespace/.cache/deno/npm/registry.npmjs.org/http_ece/1.1.0/ece.js:509:17)
at Object.encrypt (file:///home/codespace/.cache/deno/npm/registry.npmjs.org/web-push/3.6.3/src/encryption-helper.js:45:26)
at Object.WebPushLib.generateRequestDetails (file:///home/codespace/.cache/deno/npm/registry.npmjs.org/web-push/3.6.3/src/web-push-lib.js:244:10)
at Object.WebPushLib.sendNotification (file:///home/codespace/.cache/deno/npm/registry.npmjs.org/web-push/3.6.3/src/web-push-lib.js:341:29)
at sendNotificationToEndpoint (file:///workspaces/pusher/versions/v1/services/push_service.ts:131:19)
at sendNotification (file:///workspaces/pusher/versions/v1/services/push_service.ts:98:11)
at eventLoopTick (ext:core/01_core.js:183:11)
at async file:///workspaces/pusher/versions/v1/v1.ts:31:3 {
name: "BadResource"

@bhamme
Copy link

bhamme commented Aug 12, 2023

@MiguelRipoll23 I'm running into this as well. Have you found any workarounds?

@MiguelRipoll23
Copy link
Author

@bhamme nope. I'm just waiting patiently as they're working on so many things at the same time.

I don't know how hard is it to fix the error as I'm don't understand exactly what's happening.

If they need some sample code to reproduce the issue I'd post it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly node compat
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants