Skip to content

internet.jwt() fails on documentation website #3285

@xDivisionByZerox

Description

@xDivisionByZerox

Pre-Checks

Describe the bug

When running faker.internet.jwt() on our documentation site, you receive an runtime error:

+esm:13 Uncaught TypeError: Unknown encoding: base64url
    at Uint8Array.Yi (+esm:13:5072)
    at Uint8Array.a [as toString] (+esm:13:5949)
    at ir (chunk-3QROWZCZ.js:1:5396)
    at kr.jwt (chunk-3QROWZCZ.js:1:18786)
    at <anonymous>:1:16

This might affect other browser environments as well (at least the ones using the same CDN).

Minimal reproduction code

Go to https://fakerjs.dev and open the dev tools.

Run the following:

await enableFaker();
faker.internet.jwt();

Additional Context

Our check for the existance of Buffer fails because the file (https://cdn.jsdelivr.net/npm/@faker-js/faker@9.2.0/+esm) loaded from the cdn includes a Buffer polyfill:

image

Environment Info

Tested in Microsoft Edge - Version 131.0.2903.63 (Offizielles Build) (64-Bit)

Which module system do you use?

  • CJS
  • ESM

Used Package Manager

npm

Metadata

Metadata

Assignees

Labels

c: bugSomething isn't workingc: docsImprovements or additions to documentationc: externalIssues that related to external servicesp: 1-normalNothing urgent

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions