Skip to content

Buffer is not a browser method #288

Description

@sartaj-devoted

PubNub client has been failing for us since we upgraded to the latest Webpack, which no longer polyfills nodejs methods.

Screen Shot 2022-09-06 at 9 40 43 PM

The issue here is that this library uses a non standard global Buffer method. There may be a case where this is failing for others who have upgraded to the latest compilers too.

Some thoughts:

  1. Convert to using browser standards for buffers.
  2. If that is not in the timelines, perhaps make the error more graceful, with the library explicitly checking for if Buffer exists. I wouldn't be surprised if other users of PubNub are not aware their client started failing due to a webpack upgrade.

As an aside, are there docs on where/how to handle errors like this? We weren't aware of the issue for months as nothing obvious was erroring within the addListener({message method, and logVerbosity:true did not surface any errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions