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

Serverless offline does not track hot reload changes #62

Closed
AlpacaGoesCrazy opened this issue Jan 3, 2020 · 8 comments
Closed

Serverless offline does not track hot reload changes #62

AlpacaGoesCrazy opened this issue Jan 3, 2020 · 8 comments
Labels
wontfix This will not be worked on

Comments

@AlpacaGoesCrazy
Copy link
Contributor

AlpacaGoesCrazy commented Jan 3, 2020

Steps to reproduce:

  1. Open and start up server and app example.
  2. Change something in server while sls offline is running. For example:
const server = new Server({
  connectionManager,
  eventProcessor: new DynamoDBEventProcessor(),
  resolvers,
  subscriptionManager,
  typeDefs,
  context: () => {
    console.log('test')
    return {}
  }
});
  1. Serverless offline webpack will rebuild the server application.
  2. Reload client application.

Expected behavior:
'test' will be output in sls console when client reconnects
Actual behavior:
nothing is output to console and no changes to the code affect running application.

If you stop serverless offline and restart changes to the code will take effect.

version: 1.0.0-alpha.1

@michalkvasnicak
Copy link
Owner

This is not really a bug with package but rather the problem with chat-example-server serverless configuration. (there is serverless-webpack plugin used to compile the app).

@michalkvasnicak michalkvasnicak added the help wanted Extra attention is needed label Jan 3, 2020
@AlpacaGoesCrazy
Copy link
Contributor Author

Well, my project where I use aws-lambda-graphql has the same problem with serverless-webpack, however without aws-lambda-graphql hot reload works just fine

@michalkvasnicak
Copy link
Owner

Does your project work correctly if you instantiate some class in a module scope the same way as Server is instantiated?

Isn't this somehow related to this that everything is being invalidated except the handler file?

@AlpacaGoesCrazy
Copy link
Contributor Author

Isn't it the same as instantiating ApolloServer from apollo-server-lambda?
This works just fine with serverless-webpack

@michalkvasnicak
Copy link
Owner

You are right it is the same. But the problem is weird because Server just extends the Apollo one. Is this problem related to both HTTP and WebSocket handlers? Because HTTP handler is processed using Apollo's handler and websocket is custom.

@AlpacaGoesCrazy
Copy link
Contributor Author

AlpacaGoesCrazy commented Jan 3, 2020

Only websocket part is affected.
I also had an idea that ordering plugins in serverless.yml might affect this behavior, but it does not seem to affect this.

@AlpacaGoesCrazy
Copy link
Contributor Author

Well, seems like it is the problem of serverless-offline plugin
dherault/serverless-offline#764

@michalkvasnicak michalkvasnicak added wontfix This will not be worked on and removed help wanted Extra attention is needed labels Jan 3, 2020
@michalkvasnicak
Copy link
Owner

michalkvasnicak commented Jan 3, 2020

Thank you for the investigation 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants