https://serverless-stack.com/ logo
#help
Title
# help
a

Alexandru Simandi

05/06/2022, 10:33 AM
I am no longer getting a prompt on infrastructure changes. The normal watch for lambdas is working fine (found the hard way that it had to be cast once to enable watch). When running again sst start the infrastructure change applies. Might it be an issue with the cf diff? Might it be something wrong in my tsconfig?
My project structure is
Copy code
/infrastructure (where I have the stack defined
/lib (where I instantiate the stack)
/src (where i have the lambda)
the tsconfig for the root project is
Copy code
{
  "compilerOptions": {
    "target": "ES2020",
    "module": "commonjs",
    "lib": [
      "es2020",
      "dom"
    ],
    "rootDirs": [
      "src/",
      "lib/",
    ],
    "moduleResolution": "node",
    "composite": true,
    "declarationMap": true,
    "declaration": true,
    "strict": true,
    "noImplicitAny": true,
    "strictNullChecks": true,
    "noImplicitThis": true,
    "alwaysStrict": true,
    "noUnusedLocals": false,
    "noUnusedParameters": false,
    "noImplicitReturns": true,
    "noFallthroughCasesInSwitch": false,
    "inlineSourceMap": true,
    "inlineSources": true,
    "experimentalDecorators": true,
    "strictPropertyInitialization": false,
    "typeRoots": [
      "./node_modules/@types"
    ]
  }
}
infrastructure and src have a simple tsconfig file
Copy code
{
    "compilerOptions": {
        "target": "ES2020",
        "module": "commonjs",
        "strictNullChecks": true,
        "lib": [
            "es2020",
        ],
        "moduleResolution": "node",
    }
}
t

thdxr

05/06/2022, 2:02 PM
I believe the issue is because you have separated stacks code into two folders
we recommend sticking with our recommended folder structure, you can take a look at what that looks like with
yarn create sst
and selecting the typescript starter
f

Frank

05/06/2022, 5:00 PM
@Alexandru Simandi let us know if the moving all stacks into the same folder works for you
a

Alexandru Simandi

05/09/2022, 9:14 AM
@Frank I have located the problem. The watch is only monitoring the stack folder for infrastructure changes. I have the routes defined in the back-end folder so it does rebuild the lambda but not the stack unless I also edit a random line in the stack folder. It used to work in earlier sst versions. Hard to pinpoint which version.
0.39
was fine and it stopped working at some point up to
0.65.5
It seems to be expected behavior, is there any way to override the watch for infrastructure?
3 Views