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

Local dev server keeps crashing #3017

Open
cesarvarela opened this issue Aug 13, 2024 · 1 comment
Open

Local dev server keeps crashing #3017

cesarvarela opened this issue Aug 13, 2024 · 1 comment
Labels
Stack: DevOps Issues pertaining to developer experience, operations, and deployment

Comments

@cesarvarela
Copy link
Collaborator

cesarvarela commented Aug 13, 2024

Starting a local server via gatsby develop or gatsby serve eventually leads to a heap memory crash. This gets in the way of development but, more importantly, causes a lot of flake during tests.

There is an open issue on Gatsby's repo that shows we are not the only ones getting these crashes, although the cause is not always the same:

My current guess is that /api/* functions are leaking, not because of our implementation but because of how Gatsby handles them. So a way out of this could be to manage serving functions using Netlify (or Cloudflare) dev environment.

@cesarvarela cesarvarela added the Stack: DevOps Issues pertaining to developer experience, operations, and deployment label Aug 13, 2024
@cesarvarela
Copy link
Collaborator Author

Currently, Cloudflare does not support the entire Node API, so it is not usable for us to host the graphql endpoint.

https://developers.cloudflare.com/workers/runtime-apis/nodejs/

Besides that, even if they implemented the missing Node packages, they expect packages to be required using the node: prefix, which is at the moment incompatible with most packages we depend on.

Node.js APIs are available under the node: prefix, and this prefix must be used when importing modules, both in your code and the npm packages you depend on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stack: DevOps Issues pertaining to developer experience, operations, and deployment
Projects
None yet
Development

No branches or pull requests

1 participant