gr2m / gr2m/universal-github-app-jwt
Throw useful error if `atob` / `btoa` are not defined
- Dominant language
- JavaScript
- Stars
- 34
- Forks
- 16
- PR merge metrics
- No merged PRs in 30d
Description
`universal-github-app-jwt` is a universal library with different code for Node/Browser. It has a `"browser"` key to override the entry point for browser builds:
https://github.com/gr2m/universal-github-app-jwt/blob/ac358a2a93410881e3b7db7ebe8e10e2cb0c2121/package.json#L4-L6
Unfortunately build tools such as WebPack end up using this entry point, too, even when building for Node targets. See for example: https://github.com/octokit/auth-app.js/issues/59. There has been a lot of discussion around this topic, but no conclusion on how to resolve it.
But the least we could do is to check if `atob` exists in [src/utils.ts](https://github.com/gr2m/universal-github-app-jwt/blob/ac358a2a93410881e3b7db7ebe8e10e2cb0c2121/src/utils.ts). If it doesn't, then throw a helpful error which could include a link to the README file where we could add some information about this challenge.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.