Dan Van Brunt
12/09/2021, 9:13 PMError: Cannot find a "tsconfig.json" in the function's srcPath
thdxr
12/09/2021, 9:15 PMDan Van Brunt
12/09/2021, 9:15 PM.build
folders being created…Dan Van Brunt
12/09/2021, 9:15 PMtsconfig.json
{
"compilerOptions": {
"typeRoots": ["./src/_types", "./node_modules/@types"],
},
"extends": "@tsconfig/node14",
"include": ["stacks", "src"],
}
Dan Van Brunt
12/09/2021, 9:17 PM.eslintrc.js
module.exports = {
root: true,
extends: [
'serverless-stack',
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
'plugin:prettier/recommended'
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2019,
sourceType: 'module',
tsconfigRootDir: __dirname,
project: './tsconfig.json',
files: '*.ts'
},
rules: {
'@typescript-eslint/no-floating-promises': ['error'],
'@typescript-eslint/no-unused-vars': ['warn', { 'argsIgnorePattern': '^_' }]
}
}
Dan Van Brunt
12/09/2021, 9:18 PMtsconfigRootDir: __dirname,
is the issue? thought I had this working before though.Dan Van Brunt
12/09/2021, 9:20 PMsst.Api
code was doing it…. where as I also have two other sst.Function
s that are working/building finethdxr
12/09/2021, 9:22 PMDan Van Brunt
12/09/2021, 9:23 PMconst api = new sst.Api(this, 'Api', {
routes: {
'GET /githubwebhook': 'src/githubwebhook.handler',
},
})
Dan Van Brunt
12/09/2021, 9:24 PMthdxr
12/09/2021, 9:24 PMthdxr
12/09/2021, 9:25 PMsrcPath
sets that to your project root and all builds happen relative from there (which is why you get another .build) folderthdxr
12/09/2021, 9:25 PMthdxr
12/09/2021, 9:26 PMDan Van Brunt
12/09/2021, 9:28 PMnew sst.Api(this, 'Api', {
routes: {
'GET /githubwebhook': `src/githubwebhook.handler`
}
}
new sst.Api(this, 'Api', {
routes: {
'GET /githubwebhook': {
function: {
srcPath: 'src/',
handler: 'githubwebhook.handler',
}
}
}
}
Dan Van Brunt
12/09/2021, 9:29 PMnew sst.Api(this, 'Api', {
routes: {
'GET /githubwebhook': {
function: {
handler: 'src/githubwebhook.handler',
}
}
}
}
Dan Van Brunt
12/09/2021, 9:31 PMthdxr
12/09/2021, 9:34 PMthdxr
12/09/2021, 9:34 PMthdxr
12/09/2021, 9:34 PMDan Van Brunt
12/09/2021, 9:34 PMthdxr
12/09/2021, 9:45 PMDavide Ungari
12/15/2021, 10:48 PM