Skip to content

🔧 TypeScript Type Check fails in CI but passes locally #57

Description

@GMNAPI

Descripción

El check de TypeScript Type Check falla en GitHub Actions CI pero funciona correctamente en entorno local.

Error en CI

##[error]../../node_modules/.pnpm/@vitejs+plugin-react@5.1.2_vite@7.2.7/node_modules/@vitejs/plugin-react/dist/index.d.ts(64,113): error TS1003: Identifier expected.
##[error]../../node_modules/.pnpm/@vitejs+plugin-react@5.1.2_vite@7.2.7/node_modules/@vitejs/plugin-react/dist/index.d.ts(64,130): error TS1128: Declaration or statement expected.

Contexto

Estado Actual de CI (PR #55)

Checks Pasando (4/5):

  • Lint & Format Check
  • Run Tests (80%+ coverage)
  • Security Audit
  • build-lab (Docusaurus)

Check Fallando (1/5):

  • TypeScript Type Check

Causa Aparente

El error está en los archivos de tipos de @vitejs/plugin-react en node_modules, no en nuestro código fuente. Esto sugiere:

  1. Diferencia en la resolución de dependencias entre local y CI
  2. Problema de compatibilidad de versiones en el lockfile
  3. Posible issue con la versión de TypeScript vs. tipos de dependencias

Configuración Actual

tsconfig.json ya incluye:

{
  "compilerOptions": {
    "skipLibCheck": true,
    "target": "ES2017",
    "lib": ["dom", "dom.iterable", "esnext"],
    "strict": true,
    "noEmit": true
  }
}

Archivos Relevantes

  • apps/portfolio/tsconfig.json
  • apps/portfolio/package.json (dependencies de Vitest)
  • .github/workflows/ci.yml (TypeScript Type Check job)
  • pnpm-lock.yaml

Posibles Soluciones

  1. Actualizar dependencias:

    pnpm update @vitejs/plugin-react vite vitest
  2. Ajustar tsconfig en CI:

    • Asegurar que skipLibCheck: true se respeta
    • Verificar exclude patterns
  3. Verificar compatibilidad de versiones:

    • TypeScript 5.9.3
    • @vitejs/plugin-react 5.1.2
    • Vite 7.2.7
  4. Alternativa temporal:

    • Modificar workflow CI para usar tsc --skipLibCheck explícitamente

Impacto

  • Bajo: El código TypeScript es válido y funciona correctamente
  • No bloquea: 4/5 checks pasan, incluyendo tests y build
  • Solo CI: Ambiente local funciona sin problemas

Prioridad

Media - No bloquea desarrollo pero debe resolverse antes de merge a master

Etiquetas Sugeridas

bug, ci, typescript, monorepo

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions