commercetools / nodejs

Everything related to the Node.js ecosystem for the commercetools platform.
https://commercetools.github.io/nodejs/
MIT License
75 stars 70 forks source link

Missing required polyfill for `sdk-middleware-http` package #1800

Closed CarlosCortizasCT closed 1 year ago

CarlosCortizasCT commented 2 years ago

Description

When using the @commercetools/sdk-middleware-http it seems you need to include a polyfill for Buffer in your project if you need to use this package in a browser environment but this is not mentioned in the docs.

Expected Behavior

The docs should mention the Buffer polyfill requirement for browser environments.

Current Behavior

When using this package in a browser environment and using a middleware in a request with a payload, the application will crash because the Buffer object does not exist in the browser.

Context

This problem was discovered when working with the @commercetools-frontend/sdk package from the Merchant Center application kit.

Possible Solution

ajimae commented 1 year ago

This has been fixed here and here

As for the Polyfills, we will create a proper documentation about this.

Thank you