0

the line

publicKey = Buffer.from(publicKey, 'base64url');

throws

uncaughtException server.js TypeError [ERR_UNKNOWN_ENCODING]: Unknown encoding: base64url
    at fromString (buffer.js:451:13)
    at Function.from (buffer.js:305:12)
    at Object.validatePublicKey (C:\Users\libor\OneDrive\Escritorio\todo\dev\Aplay\proyectos\cms-mimediodetest3\node_modules\web-push\src\vapid-helper.js:107:22)

I'm using node:12.22.12 and buffer:3.6.4
I have searched for fixes and found nothing
I have searched in the docs and buffer accepts base64url
I have no idea what to do

  • I think you have mentioned the wrong encoding. Should be 'base64' instead of 'base64url' – Vaulstein Aug 08 '23 at 14:52
  • @Vaulstein It is intentional, it even is contemplated in the buffer docs, the code with the error isn't mine tho, is from a module, but the error itself doesn't make sense given all this things – Gaspar Liboreiro Aug 08 '23 at 14:55

0 Answers0