Skip to content
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

Cannot call this.emitFile for asset with Uint8Array in browser: Buffer is not defined #3450

Closed
nitsky opened this issue Mar 21, 2020 · 2 comments

Comments

@nitsky
Copy link
Contributor

nitsky commented Mar 21, 2020

In the browser build of rollup, when I call this.emitFile from a plugin for an asset with a Uint8Array as the source, I get a crash: "Buffer is not defined".

Below is a link to the line that assumes Buffer is defined globally. Buffer is not available in the browser.
https://github.com/rollup/rollup/blob/master/src/utils/FileEmitter.ts#L113

Here is the specification in the types that Uint8Array should be allowed:
https://github.com/rollup/rollup/blob/master/src/rollup/types.d.ts#L130

  • Rollup Version: 2.1.0
  • Operating System (or Browser): Browser
@lukastaegert
Copy link
Member

Definitely a bug, thanks for reporting.

@lukastaegert
Copy link
Member

Resolved via #3452

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

No branches or pull requests

2 participants