Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work in browsers as of 5.3.1 #525

Closed
cbrianball opened this issue Feb 9, 2023 · 1 comment · Fixed by #526
Closed

Does not work in browsers as of 5.3.1 #525

cbrianball opened this issue Feb 9, 2023 · 1 comment · Fixed by #526
Labels
type/bug Something isn't working

Comments

@cbrianball
Copy link

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.

@lholmquist lholmquist added the type/bug Something isn't working label Feb 10, 2023
@lholmquist
Copy link
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

lholmquist added a commit to lholmquist/sdk-javascript that referenced this issue Feb 10, 2023
…aking becuase of process not being found.

Signed-off-by: Lucas Holmquist <[email protected]>
lholmquist added a commit to lholmquist/sdk-javascript that referenced this issue Feb 10, 2023
…aking becuase of process not being found.

fixes cloudevents#525

Signed-off-by: Lucas Holmquist <[email protected]>
lance pushed a commit that referenced this issue Feb 12, 2023
…se of process not being found. (#526)

fixes #525

Signed-off-by: Lucas Holmquist <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants