Skip to content

Uncaught (in promise) ReferenceError: Buffer is not defined #326

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

Closed
Jellebecir opened this issue Jan 27, 2025 · 5 comments · Fixed by #327
Closed

Uncaught (in promise) ReferenceError: Buffer is not defined #326

Jellebecir opened this issue Jan 27, 2025 · 5 comments · Fixed by #327

Comments

@Jellebecir
Copy link

Two weeks ago I was able to export my design tokens via URL but when I tried exporting them again today I got an error that Buffer is not defined.

These are my export settings.
Image

The error occurs when I click the 'save & export' button in the form. If I click the button a second time I get Uncaught SyntaxError: "[object Object]" is not valid JSON

The issue seems to be on this line ->

const encodedContent = utf8ToBase64(clientPayload.tokens)

I've also tried to export a different file but I get the same error.

@0m4r
Copy link
Collaborator

0m4r commented Jan 27, 2025

hi @Jellebecir I think the reason might be this line of code:

return Buffer.from(binString, 'binary').toString('base64')

I'll have a look :S

@0m4r
Copy link
Collaborator

0m4r commented Jan 28, 2025

@Jellebecir this is fixed in #327
@lukasoppermann this should really be a quick review ;)

@Jellebecir
Copy link
Author

Awesome, thanks!

@lukasoppermann
Copy link
Owner

It is released, @Jellebecir please let us know if this fixes it.

@Jellebecir
Copy link
Author

Just checked it and it works again. Cheers everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants