Hey guys, updated to version `0.57.2` today and it...
# sst
c
Hey guys, updated to version
0.57.2
today and it doesn’t seem like
sst start
is running the type checking or linting anymore. Didn’t see any changes in the release log. My
"lint"
and
"typeCheck"
values are still set to
true
in
sst.json
and
.eslintrc
is below. Any ideas?
Copy code
{
  "env": {
    "es2021": true
  },
  "extends": [
    "eslint:recommended",
    "plugin:@typescript-eslint/recommended",
    "serverless-stack"
  ],
  "parser": "@typescript-eslint/parser",
  "parserOptions": {
    "ecmaVersion": 12,
    "sourceType": "module"
  },
  "plugins": [
    "@typescript-eslint"
  ],
  "rules": {
    "@typescript-eslint/no-empty-interface": "OFF"
  }
}
t
We only typecheck and lint for "active" functions now
Aka functions that are being live debugged and have been invoked once
c
Ahh okay so, if I have an ApolloApi (one big func) that is being invoked… and I add something that should not compile in typescript, should I expect to see an error?
I am seeing the below log. But no error
Copy code
[0] Functions: Building . src/graphql/server.handler...
[0] Functions: Done building . src/graphql/server.handler (152ms)
t
Hm let me check when I get home. New system should spawn linting and typechecking after
c
Any new deets here? I kept trying to get some type checking logs to show but couldn’t seem to do it
f
Hey @colin, just wanted to follow up real quick, r u still seeing the same behavior?
c
Hey Frank! Still seeing this behavior.. Unless I’m missing something. For example I added a block that should throw a lint error based on my config.
Copy code
const foo = () => {}
But when I invoke the function, all I see is the following.
Copy code
[0] Functions: Building . src/graphql/server.handler...
[0] Functions: Done building . src/graphql/server.handler (157ms)
Current version is
0.60.6
@Frank
t
Hey going to try to recreate this today
Will get back to you
c
Cool let me know if I can assist
Hey guys any update here? I’m eager to update to from
0.43.3 -> 0.61.3
but it seems linting and typechecking errors aren’t throwing/logging anything during local lambda development. This is within an
ApolloApi
construct.
t
Hey colin how important is it to get this in the sst terminal? Do you not have this already in your editor?
I wasn't able to recreate your issue right away
c
@thdxr I suppose not too important, I was just expecting build failure if for example I have something that will not compile in typescript.
t
what we've been seeing across the ecosystem is that tools like ours don't directly do typechecking and instead rely on editor behavior. It's a bit hard to support everyone's various configurations. And for releases people generally run
tsc
prior to calling
sst deploy
We do kick off a
tsc
whenever your function changes though and you should see errors in the terminal but I'll double check this is working
c
Okay so maybe that is whats throwing me, I figured that tsc would throw an error
I was thinking I wouldn’t have to run an
npm build
or a seed deploy to see if something wasn’t compiling
And that makes sense re: configurations. I just want to make sure I understand where I am going wrong. As after the updates I’m seeing
SyntaxError: Unexpected token '?'
on deploy which seems to tell me I need to manually run
tsc
t
hm I don't think you need to manually run tsc for actually compilation
you should only need to run it with
--noEmit
for type checking
where are you seeing that SyntaxError
c
That was on a seed build. From the following command
npx sst build --stage dev --verbose
which is strange because on my local with the same command I dont see the error. This may be unrelated. Potentially to a node version mismatch
Upgrading our build images to see if thats an issue.
f
Just to chime in guys, @colin which build image r u using on Seed? I wonder if it’s of a different Node version as ur local.
c
Yep, I just upgraded the build image on Seed and that resolved the compilation issue. Sorry to distract with that @thdxr. So I think my only real question is, If I add something that should not compile in an “active” lambda, should I expect to see a tsc error when sst tries to build it? (Currently I just see the built successfully) message. Totally understand y’alls point on linting and I can tackle that any number of different ways.
t
@colin yeah so sst build doesn't run typechecking, people typically conflict a
tsc --noEmit
command to run before
sst deploy
c
@thdxr Copy that. But the same is not true for local dev with
npm start
correct? You mentioned you guys do kick off a
tsc
in that case?
t
Yeah we do kick it off after a function rebuilds but we do not wait for it (it's super slow) and we might remove this at some point