8000 Fix buffer is not defined warning · Issue #172 · inkit/docgen · GitHub
[go: up one dir, main page]

Skip to content

Fix buffer is not defined warning #172

Open

Description

@mtmacdonald

Sometimes seeing this in the console, in relation to PDF ...

Image

Activity

  1. added 4 commits that reference this issue on Jan 5, 2026
  2. self-assigned this
    on Jan 6, 2026
  3. mtmacdonald commented on Jan 15, 2026

    @mtmacdonald
    ContributorAuthor

    Reopening this - I had to revert the "fix" in PR189. Status:

    • My first preference would be for the @react-pdf project to stop depending on buffer. From #2758 - according to this comment there was a prior fix in PR1891, but later changes re-introduced the dependency on buffer. I also found another ticket #3225 that has been open some months.
    • My second preference is to polyfill buffer. I am waiting for:
      • Either better Vite 8 guidelines on how: #21385
      • Or for blockers in vite-plugin-node-polyfills with Vite 8 to be resolved:
        • #144 security
        • The production build still shows Buffer is undefined even when using this package (latest version, with latest Vite 8 beta)
        • Minor console warnings #142

    This task is blocked. But the app is functional (it concerns a runtime warning that does not impact using the app).

  4. CraigIntuety commented on Feb 9, 2026

    @CraigIntuety

    I know you mention everything runs as expected, but im getting increased cpu/ram usage to the point my fans kick in on my laptop because of the volume of console warnings.

  5. mtmacdonald commented on Feb 17, 2026

    @mtmacdonald
    ContributorAuthor

    I know you mention everything runs as expected, but im getting increased cpu/ram usage to the point my fans kick in on my laptop because of the volume of console warnings.

    Hi @CraigIntuety - I think the best plan for the Buffer is not defined warning is if we add a manual polyfill, since vite-plugin-node-polyfills seems to be lagging a bit maintenance-wise when it comes to the upcoming Vite 8 release. To do that, I would probably look at upcoming Vite docs instructions in node polyfills. I'm not convinced this warning is related to performance, however. Generating the PDF the first time you load it happens in the dynamically in browser in a webworker, and make take some time/resources (probably depends on the size of the PDF you are generating, and the specs of your machine).

    Going forward, this project has been acquired by Inkit - you can reach out to them directly if you need further support: https://www.inkit.com/contact-us.

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    0