Skip to content

Does not work in browsers as of 5.3.1 #525

Closed

Description

@cbrianball

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

  1. Create website project (e.g., npm create vite@latest)
  2. Install any version of cloudevents > 5.3.0
  3. Add import { CloudEvent } from "cloudevents" to a javascript file (and use it to ensure tree shaking doesn't remove the code).
  4. Run the application
  5. 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.

Activity

  1. lholmquist commented on Feb 10, 2023

    @lholmquist
    Contributor

    I've reproduced the error using the websocket example

    Looks like this is an issue in the util package when using webpack 5, browserify/node-util#57 (comment)

    i have a fix that i'll PR in a little later

  2. added 2 commits that reference this issue on Feb 10, 2023
  3. added a commit that references this issue on Feb 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions