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

fix(node-ws): CloseEvent is not defined #648

Merged
merged 6 commits into from
Jul 18, 2024

Conversation

Yovach
Copy link
Contributor

@Yovach Yovach commented Jul 17, 2024

Currently, CloseEvent doesn't exist in the latest versions of Node.js (v18.20.4, v20.15.1 and v22.4.) and you'll get the following error Uncaught ReferenceError: CloseEvent is not defined if you have this :

app.get(
  '/',
  upgradeWebSocket(() => ({
    onClose() {
      // doing some stuff
    },
  }))
)

Fixes #595

Copy link

changeset-bot bot commented Jul 17, 2024

🦋 Changeset detected

Latest commit: 86632ad

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@hono/node-ws Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Yovach Yovach changed the title fix(node-ws): CloseEvent doesn't exists fix(node-ws): CloseEvent is not defined because not exposed to global Jul 17, 2024
@Yovach Yovach changed the title fix(node-ws): CloseEvent is not defined because not exposed to global fix(node-ws): CloseEvent is not defined Jul 17, 2024
@yusukebe
Copy link
Member

Hi @Yovach

Looks good to me! One thing. Can you run yarn changeset on the top of the project and push the changeset?

@nakasyou Can you also review this?

packages/node-ws/src/events.ts Outdated Show resolved Hide resolved
@yusukebe
Copy link
Member

@nakasyou Thank you for your review!

@Yovach I'll merge it into the main and release the new version. Thank you!

@yusukebe yusukebe merged commit 139e34a into honojs:main Jul 18, 2024
1 check passed
@github-actions github-actions bot mentioned this pull request Jul 18, 2024
@Yovach Yovach deleted the fix/node-ws-closeevent-not-exists branch July 19, 2024 05:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[@hono/node-ws] ReferenceError: CloseEvent is not defined
3 participants