Branko Gvoka
07/06/2021, 9:58 AMtypecheck: true
is set, I’m getting type errors. I’ve tried to exclude node_modules in tsconfig but also no luck 🙂 Not my luckiest day.Frank
tsconfig
looks like?Branko Gvoka
07/07/2021, 5:45 AM{
"compilerOptions": {
"target": "ES2018",
"module": "commonjs",
"lib": ["es2018"],
"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"],
"paths": {
"@packages/*": ["./packages/*"],
}
},
"include": ["lib", "services", "packages"]
}
Branko Gvoka
07/07/2021, 7:24 AMFrank
srcPath
in the other thread. SST expects the tsconfig.json
to be inside there - https://docs.serverless-stack.com/constructs/Function#srcpathFrank
Branko Gvoka
07/08/2021, 10:52 AMBranko Gvoka
07/09/2021, 11:43 AM{
"extends": "../../tsconfig.json",
"compilerOptions": {
"baseUrl": "."
},
"include": [
"src"
]
}
In the monorepo, we’re running in the root of project sst start
there it should load according tsconfig I assume
Any other hints? 🙂Frank
Frank
Branko Gvoka
07/14/2021, 3:39 PMBranko Gvoka
07/17/2021, 1:28 PMBranko Gvoka
07/17/2021, 1:32 PMCannot find a "tsconfig.json" in the function's srcPath: /Users/.../projectName/services/serviceName
Should I add tsconfig that extends the root one? Can it reference somehow the root automatically? What is best practice I guess? 🙂Frank
srcPath
b/c that’s where your package.json
is?Branko Gvoka
07/17/2021, 9:42 PMTranspiling Lambda code...
> node_modules/@prisma/client/runtime/index.js:24726:23: error: Could not resolve "_http_common" (mark it as external to exclude it from the bundle)
24726 │ var common = require("_http_common");
🙂Frank
srcPath
cannot be pointed to the app root (where tsconfig.js
is), we’d need to support custom tsconfig.js
pathBranko Gvoka
07/18/2021, 11:28 AMJay
Frank