You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Uncaught ReferenceError: Buffer is not defined #72
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.
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.
I've been asked to make a site that takes linked tables from DB and allows the user to generate scripts for create/update/delete. In most cases I have the fields I need, but in some cases I need to swap a number for a variable due to identity fields being used as FK.
Your library does most of what I need, except for when I try to use the raw method to swap out the number for a variable.
Activity
sidorares commentedon Mar 16, 2026
Can you give more context on how you plan to use this library? It was not designed to be used from browser runtime
KennethJamesCurrie commentedon Mar 16, 2026
I've been asked to make a site that takes linked tables from DB and allows the user to generate scripts for create/update/delete. In most cases I have the fields I need, but in some cases I need to swap a number for a variable due to identity fields being used as FK.
Your library does most of what I need, except for when I try to use the raw method to swap out the number for a variable.
sidorares commentedon Mar 17, 2026
Are you trying to access DB directly from the browser?
KennethJamesCurrie commentedon Mar 17, 2026
No, generating SQL files.