Open jayair opened 1 week ago
Is this issue only for frontends? I see something similar that requires me to also manually restart sst dev
, but for a NestJS API dist/ folder.
My ApiGatewayV2+Function (./infra/service.ts
):
const functionArgs: FunctionArgs = {
runtime: 'nodejs20.x', // fixes issue where al2023 is defaulted and a bootstrap binary is included in zip
bundle: 'dist/apps/my-service',
handler: 'main.handler',
url: true,
dev: false,
// link: [templates, documents],
copyFiles: [
{ from: 'dist/apps/my-service/main.js', to: 'main.js' },
],
};
export const api = new sst.aws.ApiGatewayV2('MyApi');
api.route('$default', functionArgs);
Notice it should deploy my dist folder (nested since this is a nestjs monorepo with an apps/ subfolder) by watching it for changes. dist
is already autodeleted and rebuilt into commonjs format of main.js every time I used my nest build
command.
But, sst dev
does not detect the changes to dist
bundle. I had to manually restart it for it to redeploy.
Side Note:
I'm not sure if (the dev: false
) is related, but removing it makes my api respond with "it does not seem like sst dev is running" which is not true. Using dev: false
makes it respond properly (firing at the endpoint URL from my local terminal curl command) .
we likely have an issue with using bundle
in dev mode
can you make an other issue for that?
Tested this in Astro, saw the same thing.
Say I have a Next.js app running locally through
SOME_ENV_VAR=FOO sst dev
.Now if I restart it with
SOME_ENV_VAR=BAR sst dev
, it doesn't update the env var.You need to restart
sst dev
again for it to take effect. Applies to resource links as well.