fix(dev): fix hot reloading and Localstack port #324
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Solution
Hot reloading
Running
ts-node-dev
with the--debug
flag showed the following issue:The SIGTERM was somehow failing for the child process. To fix this, I added the
--exit-child
flag (docs).Localstack
Since the ports for individual services are due to be deprecated anyway, I thought we should try to switch to the edge port 4566. However, when I tried to switch, I got the following error:
I figured this was probably related to the fact that we had a hackish way of initialising our S3 buckets. Rather than using the documented way of initialising AWS resources, we were using
init-localstack.sh
to repeatedly pinglocalhost:4572
until Localstack was ready, before initialising the S3 buckets. Since we are now using the latest version of Localstack which supports initialisation scripts, I removed the pinging code and added the bucket initialisation code to/docker-entrypoint-initaws.d
.Unsolved mysteries
Local emails are still broken for me due to the same error encountered by @frankchn which necessitated #285. However, not everyone seems to be facing the same issue, so this is likely due to some local configuration problem.