Is there a way to avoid type-checking over depende...
# sst
a
Is there a way to avoid type-checking over dependencies? Middy apparently imports x-ray, but I’m not using that.
t
what does your tsconfig look like?
a
Copy code
{
  "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,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "strictPropertyInitialization": false,
    "typeRoots": [
      "./node_modules/@types"
    ],
    "paths": {
      "@heyyabble/*": [
        "./src/packages/*"
      ]
    }
  },
  "include": [
    "lib",
    "src"
  ]
}
Not sure why is checking the node_modules apparently.
I’m using version 0.39.0 by the way, due the problem on empty-stacks.
t
this tsconfig.json is in the same directory as sst.json ?
a
Yes sir.
Is the only one I have.
It shouldn’t check the node_modules right?
t
yeah it shouldn't that's strange
a
Going to upgrade to latest sst.
t
Oh this isn't a type checking error this is a compilation error. Can you add that package and see if it fixes it?
a
Mmm.
This is a type error after I enabled type check.
Copy code
"lint": true,
  "typeCheck": true
I had typeCheck: false
Due I had several issues.
And all worked fine with false.
Now that is true, I get this error.
Makes sense?
t
What I meant by type checking error is that it's not an error coming from type issues. The way this works is if
typeCheck: true
is on we run
tsc
. Then we run
esbuild
which doesn't do as much as
tsc
but is faster and ignores more since it does tree shaking. It seems typescript is seeing an optional dependency of middy and expecting it to exist. @Sam Hulick is also using middy - wonder if he saw this issue
a
Yeah, this dependency is not installed, not sure why Middy needs it.
s
weird, I don’t have
aws-xray-sdk
anywhere in my proj. are you using yarn? if so, what does
yarn why aws-xray-sdk
show?
a
Yes, I just installed it and no errors anymore.
But well, for some reason my middy uses it.
Looks like SSM-middy uses it.
s
ahh. I was gonna say, it’s probably a middy add-on
a
What a crap 😞
Is there a way to tell the type-check to ignore some folder?
Because is throwing some errors from my React folder.
Like…
Cannot find name 'Window'.
Looks like
react_router
is missing some stuff.
I think it’s because my
tsconfig
doesn’t know the DOM?
s
do you have this in your tsconfig’s
compilerOptions
?
Copy code
"lib": ["ESNext", "DOM"],
a
I have
es2018
, but I just added dom to test.
Ok, adding
dom
works.
Is that ok? I don’t want my lambdas to be affected somehow.
s
sure, it works ok for me. I don’t think it’ll affect building the code
a
Ok, hopefully, that’s the only concern I have when merging frontend and backend, haha.
It’s all TS .. but well.
t
I'm finally working on my opinionated typescript starter which should help situations like this
hopefully will have it done today
a
👍
Thanks guys.