I’m totally stuck and can’t figure out what’s wron...
# help
s
I’m totally stuck and can’t figure out what’s wrong with this config I’ve made it so
src
is a workspace.. in other words, all the Lambda & other business logic stuff in src has its own set of packages and tsconfig.
src/tsconfig.json
looks like this:
Copy code
{
  "extends": "../tsconfig.json",
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "~/*": ["./*"]
    },
  },
  "include": ["**/*", "../environment.d.ts"]
}
but when I do
yarn build
, I get this error:
Copy code
> src/core/trash/purge-deleted-items.ts:9:30: error: Could not resolve "~/libs/db" (mark it as external to exclude it from the bundle)
    9 │ import { dataApi, knex } from '~/libs/db';
why is the path alias not working?
is this a bug, maybe? when I run
yarn tsc --noEmit -p src
, it returns no errors
t
Is ~ reserved? Can you try making the alias @app or something
s
ohh wait.. ok, this is weird.
Copy code
const trashCron = new sst.Cron(this, 'AutoTrashEmptier', {
      job: 'src/core/trash/automated-purge.main',
      schedule: this.stage === 'prod' ? 'rate(4 hours)' : 'rate(48 hours)',
    });
there’s no way to set
srcPath
for this
it’s literally the only Lambda func that fails to build
all the rest have
srcPath: 'src'
hmm. shouldn’t I just set that srcPath in my
app.setDefaultFunctionProps
?
why in the world have I been setting
srcPath
manually everywhere? 😳 literally all the source code is in
src/
I have no idea why I was doing that