Skip to content

Uncaught ReferenceError: Buffer is not defined #72

@KennethJamesCurrie

Description

@KennethJamesCurrie

When using SqlString.raw the error "Uncaught ReferenceError: Buffer is not defined" is throwing when using SqlString in a react site.

This was discovered with react 17, vite 7. Interestingly the vitest tests did not have this issue indicating that the polyfill was not supplying the buffer when running the site directly but was when running the tests.

Image

If I manually add buffer to the window prior to running the raw method I don't have a problem, but I shouldn't need to implement a workaround in order to use the library's functionality.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions