Closed
Description
Describe the Bug
Based on other issues in this repo and some of the examples, it looks like this package is expected to work in the browser. Using any version after 5.3.0, there is an error in the browser console with the text "process is not defined".
Steps to Reproduce
- Create website project (e.g.,
npm create vite@latest
) - Install any version of cloudevents > 5.3.0
- Add
import { CloudEvent } from "cloudevents"
to a javascript file (and use it to ensure tree shaking doesn't remove the code). - Run the application
- Note in the browser console, the error "process is not defined"
The issue appears to be caused by the util
dependency introduced in 5.3.1.
Expected Behavior
cloudevents NPM package should work inside the browser.