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

[bug] Pending requests when using Node 16.x #1229

Closed
ApacheEx opened this issue May 12, 2021 · 9 comments · Fixed by #1235
Closed

[bug] Pending requests when using Node 16.x #1229

ApacheEx opened this issue May 12, 2021 · 9 comments · Fixed by #1235

Comments

@ApacheEx
Copy link

Bug Report

Current Behavior
When I make some XHR requests from my UI application to serverless-offline application. It always shows them with the pending status in the network tab:
image
from another side, it's started (serverless offline start) without any errors.
image

Sample Code

  • file: serverless.yml
service: my-service

plugins:
  - serverless-offline

provider:
  runtime: nodejs12.x
  stage: dev

functions:
  hello:
    events:
      - http:
          method: get
          path: hello
    handler: handler.hello
  • file: handler.js
'use strict'

const { stringify } = JSON

exports.hello = async function hello() {
  return {
    body: stringify({ foo: 'bar' }),
    statusCode: 200,
  }
}

Expected behavior/code

Environment

  • serverless version: 2.41.1
  • serverless-offline version: 7.0.0
  • node.js version: 16.1.0
  • OS: macOS 11.3.1 (apple silicon)

Possible Solution

downgrading Node to 15.9 or 14.x fixes the issue.

@karltaylor
Copy link

I had the same issue however it seems that the requests are not getting through to the application.

Env

serverless -v
Framework Core: 2.43.1
Plugin: 5.1.3
SDK: 4.2.2
Components: 3.10.0
  • node: 16.1.0
  • serverless-offline: 6.8.0

I am using serverless-http to wrap an express app, using node@16.1.0 I could make postman GET calls which returned ok. However any POST, PATCH, PUT, DELETE did not work.

Note: They did not even hit the serverless application, when I removed these routes/endpoints, it should return a 404, (This happens when removing the GET which is correct) - however, the request just hangs indefinitely.

Hopefully adds some additional information, but like @ApacheEx mentioned, downgrading works:

nvm install --lts && nvm use --lts # v14.17.0 at time of comment

@brunocalderon
Copy link

Maybe related to #1150 #1151 ?

@alienself
Copy link

Same error with Node 16.6 :(

@mauroexdefalt
Copy link

alguém com alguma solução ? aqui também as rotas param de responder se deixar no node 16

@NicolasRomeroF
Copy link

Same error with node 16.13, I have a GraphQL api and can't even do request on the graphql playground

@darbio
Copy link

darbio commented Jan 15, 2022

I still had the same error with node 16.13.1 - updating to the latest version of sls offline solved the issue. Thank you.

@jfbette
Copy link

jfbette commented Aug 9, 2022

@darbio which version of sls offline solved the problem? I have the problem too with v6.9.0

@darbio
Copy link

darbio commented Aug 9, 2022

@darbio which version of sls offline solved the problem? I have the problem too with v6.9.0

From my package.json:

"serverless-offline": "^8.8.0"

@jfbette
Copy link

jfbette commented Aug 10, 2022

@darbio I updated and now its working fine! thanks!

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 a pull request may close this issue.

8 participants