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

Websockets don't work past v8.5.x #1387

Closed
TVGG opened this issue May 2, 2022 · 11 comments
Closed

Websockets don't work past v8.5.x #1387

TVGG opened this issue May 2, 2022 · 11 comments
Labels

Comments

@TVGG
Copy link

TVGG commented May 2, 2022

Websockets don't seem to work properly as of version 8.5.x.

All websocket routes appear as route '[object Object]'
When trying to connect via wscat the following happens:

(base) C:\Users\marti> wscat -c localhost:3001
error: Unexpected server response: 502

Example route:

functions:
  defaultMessage:
    handler: src/socketFunctions/invalidRoute.main 
    timeout: 30
    events:
        - websocket:
            route: $default
  • serverless version: 3.16.0
  • serverless-offline version: 8.5.0
  • node.js version: 14.16.0
  • OS: win 10 build 19044.1645

It might be related to issue #1381

@TVGG TVGG changed the title Websockets don Websockets don't work past v 8.5 May 2, 2022
@TVGG TVGG changed the title Websockets don't work past v 8.5 Websockets don't work past v8.5.x May 2, 2022
@inuwyze
Copy link

inuwyze commented May 7, 2022

i have been having the same issue have u found any way around the problem?

@TVGG
Copy link
Author

TVGG commented May 7, 2022

@qwtfy For the moment there doesn't seem to be a solution other than installing a previous version. 8.4 seems to work fine for my needs. In my experience serverless offline releases can be pretty buggy and have issues on one operating system but not another. I have tested 8.4 and it works well enough on windows for my needs but may have issues on mac os/linux.

@SayefReyadh
Copy link

SayefReyadh commented May 18, 2022

For our project
v8.5.0 works with

serverless version: 2.52.0
node.js version: 12.13.0 / 12.x

v8.3.1 seems to also work fine along with v8.4.0 for

serverless version: 3.16.0
node.js version: 14.13.0 / 14.x

@aardvarkk
Copy link
Contributor

I ran into this issue because I had a websocket authorizer set up, but wasn't returning a context on the policy. A workaround was to just return an empty object as the context on the policy. See #1472

@TVGG
Copy link
Author

TVGG commented Jun 7, 2022

@aardvarkk Unless I am misunderstanding something I don't believe it's the same issue. In my specific case I do not use any authorizer. Would you have an example function like I provided in my original post so that I can test?

@aardvarkk
Copy link
Contributor

@TVGG If you're not using an authorizer then this wouldn't be the same issue. Just thought I'd add a comment in here to help people that are using one because it "broke" websockets for me until I made that PR to fix the issue.

@TVGG
Copy link
Author

TVGG commented Jun 7, 2022

@aardvarkk Thanks for the clarification!

@dnalborczyk
Copy link
Collaborator

#1381 was reverted in v8.8.0. could you check if your issue is gone?

If you're not using an authorizer then this wouldn't be the same issue.

it's possible that this is the same issue as that's how the handlers are run.

@dnalborczyk dnalborczyk added the bug label Jun 8, 2022
@TVGG
Copy link
Author

TVGG commented Jun 8, 2022

@dnalborczyk The problem is still unresolved for the following config

serverless version: 3.16.0
serverless-offline version: 8.8.0
node.js version: 14.16.0
OS: win 10 build 19044.1706

I have updated windows 10 since the initial post but considering the issue was my serverless-offline version last time it seems that the problem is still persists in v8.8.0.

@dnalborczyk
Copy link
Collaborator

dnalborczyk commented Jun 14, 2022

@TVGG v9 is going out the door in the next coming days. it contains some general bug fixes as well as some specific targeting Windows.

#1461

@dnalborczyk
Copy link
Collaborator

v9 was released a couple days ago. could you check if that takes care of the problem(s)?

I'm closing this issue in the meanwhile as I believe there's multiple issues bing conflated.

please open a new issue if the problem still persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants