Issue: When multiple developers run sst start --stage local, SST's Live Lambda Development sometimes routes function invocations to another developer’s machine instead of running locally.
Steps to Reproduce:
Two developers (Dev A and Dev B) each run: npx sst start --stage local
Both developers use the same MongoDB connection string from SST secrets (e.g., MONGO_URI=mongodb://localhost:27017/mydb
).
When Dev A invokes a function, it sometimes runs on Dev B's machine, leading to unintended database updates.
Expected Behavior: Each developer’s Lambda function should execute only on their own machine, even if they share the same SST stage.
Actual Behavior: Lambda requests are sometimes routed to another developer’s system. Since both use the same MONGO_URI, this results in data conflicts between local databases.
Workarounds Tried:
Using npx sst dev --disable-remote
(prevents misrouting but disables some live development features).
Running SST with unique stages (--stage devA and --stage devB), but this is not ideal for collaboration.
We did not want to use different stages as most of the resources that we use are the same. Not sure, if its a real bug but wanted to know if there are any methods we can follow to overcome this issue.