I'm trying to deploy a new SST service using Seed ...
# seed
r
I'm trying to deploy a new SST service using Seed but it's complaining it can't find a types file that's referenced using an alias from the stack definition. I.e. we have an import that looks like
Copy code
import { EnvVars } from '@/types/leadent';
and in our tsconfig.json in the root of the project we have:
Copy code
"paths": {
      "@/*": ["main/*"]
    }
Everything builds fine locally and
sst start
works perfectly. However in Seed we get a lot of compilation errors which look to be because that import hasn't been resolved. How do I tell Seed to honour the alias?
f
Hey @Ross Coundon, running
sst deploy
in Seed should behave the same way as running it locally. Can you send me a link to the build?
t
is
baseUrl
set in
tsconfig
r
yes, set to src
Copy code
{
  "compilerOptions": {
    "plugins": [
      {
        "transform": "ts-optchain/transform"
      }
    ],
    "typeRoots": [
      "./types",
      "./node_modules/@types"
    ],
    "resolveJsonModule": true,
    "target": "ES2019",
    "module": "commonjs",
    "allowJs": true,
    "checkJs": false,
    "sourceMap": true,
    "outDir": "./.build",
    "removeComments": false,
    "strict": true,
    "noImplicitAny": true,
    "esModuleInterop": true,
    "inlineSourceMap": false,
    "inlineSources": false,
    "skipLibCheck": true,
    "declarationMap": true,
    "declaration": true,
    "preserveConstEnums": true,
    "baseUrl": "src",
    "experimentalDecorators": true,
    "paths": {
      "@/*": [
        "main/*"
      ]
    }
  },
  "exclude": [
    "./jest.config.js",
    "./node_modules/**/*",
    "./build/**/*",
    "types"
  ],
  "include": [
    "lib",
    "src"
  ]
}
I see types are in the exclude array, could be a problem
Removing it from exclude array didn't help. Just now I tried removing the alias from the stack definition in case the problem was confined to the stack as opposed to the lambda code but it fails compilation when it gets to the lambdas with
Copy code
src/main/handlers/api.ts(16,72): error TS2307: Cannot find module '@/types/leadent' or its corresponding type declarations.
src/main/handlers/offersQueue.ts(7,65): error TS2307: Cannot find module '@/types/leadent' or its corresponding type declarations.
src/main/handlers/populator.ts(21,27): error TS2307: Cannot find module '@/types/leadent' or its corresponding type declarations.
src/main/lib/Utils.ts(7,27): error TS2307: Cannot find module '@/types/leadent' or its corresponding type declarations.
src/main/transit/db/OmwDb.ts(21,8): error TS2307: Cannot find module '@/types/leadent' or its corresponding type declarations.
src/main/transit/db/OmwDb.ts(350,44): error TS7006: Parameter 'slot' implicitly has an 'any' type.
Frank's looking at it, don't want you to double up unnecessarily
f
Let me create a group chat and pull @thdxr in to triage. He’s the TS guru on the team 😅