This build keeps failing on this type check step tsc --noEmit
> tpot@0.1.0 typecheck /home/runner/work/tpot/tpot
> tsc --noEmit
Error: src/components/Navbar.tsx(21,22): error TS2307: Cannot find module '~public/tpot.png' or its corresponding type declarations.
ELIFECYCLE Command failed with exit code 2.
Error: Process completed with exit code 1.
tsconfig.json is configured correctly.
This failure is only happening on Github Actions. The command is working well locally and the vercel build is succeeding. I've tried a lot of things like changing the file name, changing the imports to relative instead of absolute but nothing worked.
I need a hint on why this might be happening.
The boilerplate code create-t3-app I used, ignored next-env.d.ts
type declaration file from git which included a lot of types including image types.
This is why tsc --noEmit
is working locally but not on GitHub CLI.
I just added this file to the repo and the build is succeeding ✅