From bf5ba1b442e5a53457122db11efbbc9dd3e9020c Mon Sep 17 00:00:00 2001 From: Paul R Kartchner Date: Tue, 25 Nov 2025 13:35:31 +0000 Subject: [PATCH] fix: resolve TypeScript compilation errors for Docker build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed several TypeScript compilation issues that prevented Docker containers from building: 1. Fixed import.meta.env type error in auth.service.ts by using type assertion 2. Fixed HeadersInit type error by using Record for headers object 3. Removed unused navigate import in Register.tsx 4. Excluded test files from TypeScript compilation in tsconfig.json All containers now build and deploy successfully with authentication system fully functional. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- packages/api/tsconfig.json | 2 +- packages/web/src/pages/Register.tsx | 3 +-- packages/web/src/services/auth.service.ts | 9 ++++++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/api/tsconfig.json b/packages/api/tsconfig.json index 11f658f..4abe3d9 100644 --- a/packages/api/tsconfig.json +++ b/packages/api/tsconfig.json @@ -14,5 +14,5 @@ "types": ["node"] }, "include": ["src/**/*"], - "exclude": ["node_modules", "dist"] + "exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.spec.ts"] } diff --git a/packages/web/src/pages/Register.tsx b/packages/web/src/pages/Register.tsx index 3235c26..d932c71 100644 --- a/packages/web/src/pages/Register.tsx +++ b/packages/web/src/pages/Register.tsx @@ -3,13 +3,12 @@ */ import React, { useState } from 'react'; -import { useNavigate, Link } from 'react-router-dom'; +import { Link } from 'react-router-dom'; import { useAuth } from '../contexts/AuthContext'; import { authService } from '../services/auth.service'; import '../styles/Auth.css'; const Register: React.FC = () => { - const navigate = useNavigate(); const { register } = useAuth(); const [name, setName] = useState(''); diff --git a/packages/web/src/services/auth.service.ts b/packages/web/src/services/auth.service.ts index 8b27d70..7c55dc3 100644 --- a/packages/web/src/services/auth.service.ts +++ b/packages/web/src/services/auth.service.ts @@ -13,7 +13,7 @@ import { ResetPasswordRequest, } from '../types/auth'; -const API_URL = import.meta.env.VITE_API_URL || 'http://localhost:3001'; +const API_URL = (import.meta as any).env?.VITE_API_URL || 'http://localhost:3001'; const AUTH_ENDPOINT = `${API_URL}/api/auth`; // Token storage keys @@ -67,11 +67,14 @@ async function fetchWithAuth( options: RequestInit = {} ): Promise { const token = tokenService.getAccessToken(); - const headers: HeadersInit = { + const headers: Record = { 'Content-Type': 'application/json', - ...options.headers, }; + if (options.headers) { + Object.assign(headers, options.headers); + } + if (token) { headers['Authorization'] = `Bearer ${token}`; }