TypeError [ERR_UNKNOWN_ENCODING]: Unknown encoding: base64url
NOTE: Please test in a least two browsers (i.e. Chrome and Firefox). This helps with diagnosing problems quicker.
Setup
Please provide the following details, the more info you can provide the better.
Operating System: <Windows 10 and Mac M1 OS X> Node Version: <10.24.1 | 6.14.12 | > web-push Version: <3.3.3>
Problem
buffer.js:344 throw new ERR_UNKNOWN_ENCODING(encoding); ^
TypeError [ERR_UNKNOWN_ENCODING]: Unknown encoding: base64url at fromString (buffer.js:344:13) at Function.from (buffer.js:201:12) at Object.validatePublicKey (/node_modules/web-push/src/vapid-helper.js:108:22) at Object.WebPushLib.setVapidDetails (/node_modules/web-push/src/web-push-lib.js:60:17)
Please explain what behaviour you are seeing. I can't load the project because of this issue with web-push and base64url
Expected
Please explain what you expected to happen
Features Used
- [ ] VAPID Support
- [ ] GCM API Key
- [ ] Sending with Payload
Example / Reproduce Case
Please provide a code sample that reproduces the issue. If there is a repository that reproduces the issue please put the link here.
see this stackoverflow question from way back: https://stackoverflow.com/questions/76860652/buffer-js-throws-unknown-encoding-base64url
Other
Please put any remaining notes here.
Node 10 is not supported anymore: https://github.com/web-push-libs/web-push/blob/a93a8c41a9587ecfa18f36032f833ad31a5017c5/package.json#L53.
Alright thanks @marco-c