GitHub Action Failing Type-Checks but Working Locally
I'm setting up an automatic github action that will run type checks on my nextjs app when pushed / pr'd to main. Problem is the type checks fail in github actions but pass locally.
24 Replies
can you show package.json scripts
This is why I'm confused. Even did a fresh pull locally, npm ci, ran tsc, nothing
but the github action really doesn't love it
very weird
maybe you have some stuff installed globally
I feel like thats the only thing it could be
weird
I saw somewhere else saying it was a types/react-dom problem but mine are latest
I'll try one more thing but yeah this is weeeeeird
does it build when deploying fine
locally? yeah. I'll throw in a quick build step to see as well
no like
in a fresh enviorment
idk if your using vercel but when vercel clones + builds does it error
I don't use vercel
use DO, which uses another push action
but that builds fine (on the droplet)
so weird
what happens if you run typecheck before build on the do action
Oh, I mean I have a webook that runs on push and on my server it'll auto pull the repo, rebuild, and restart
but the logs on my DO droplet show it's building fine
so it's def an issue with github
well im stumped good luck
ping me if you figure it out
are you using relative package versions on package.json? maybe for some reason the one on CI doesn't include some new types for some new version
you can check which version you're using on your pnpm.lock / yarn.lock and include it as minimal, like
"@types/react-dom": "^18.2.4"
also checking @types/react
should be worth itHere I'll post the whole thing
I never use realives, always pin the deps
and yeah always comitting my package-lock (or else npm ci would fail)
types/react and types/react-dom are latest
yeah this is very weird, almost as package-lock for some reason was out of sync, but it probably isn't, I'm gonna try setting up a similar action to see if I run into this
yeah, inspecting my package.lock everything is right
I have no idea, this is so weird
def a github issue
I've pulled fresh on my windows desktop, mac laptop, and DO (ubuntu) droplet, installed, and ran the command and all 3 say no errors
it's literally only github
WAIT
I JUST FRESH INSTALLED ON WINDOWS AND IT FAILED
NO IDEA WHY
breakthrough time
ah, so it's a problem with react-dom 18.2.8
GitHub
'SomeComponent' cannot be used as a JSX component. · Issue #42292 ·...
Verify canary release I verified that the issue exists in the latest Next.js canary release Provide environment information Operating System: Platform: win32 Arch: x64 Version: Windows 10 Pro Binar...
glad we figured that out, thanks all
no idea why it's half working half not
but until that gets fixed
stable
production ready
hey, it's a @types/react problem, not next LMAO
oh i didnt read the issue far enough then my b
saw vercel/nextjs and assumed
when talking about server components there's almost no difference now
server components features are better documented on nextjs docs then react.dev
lol