Fixing Build Errors & Enhancing UI for JPQuiz App

📅 2025-08-10 ✍️ prosalmontech #JPQuiz#Development Notes#CSS#Next.js#React

Today, we tackled critical build errors and introduced significant UI improvements to our JPQuiz (Japanese Language Quiz) application, ensuring a smoother, more reliable, and visually refined learning experience for our global language students.

1. The Challenge: Unexpected Next.js Build Failures

During our recent deployment cycle, our continuous integration pipeline halted abruptly due to persistent build errors within the JPQuiz application module.

The compiler terminal was inundated with cryptic error messages including Expression expected and Expected ',', got 'className', indicating severe syntax parsing failures within our React JSX templates.

Upon meticulous code inspection, we identified a classic pitfall in React frontend development: inadvertently using the standard HTML attribute class="..." instead of the JSX property className="..." across newly added component templates. Because class is a reserved keyword in ECMAScript, the SWC / Next.js compiler failed during abstract syntax tree (AST) tokenization, completely halting production builds.

2. The Solution: Systematic Refactoring and Automated Linting

The immediate remediation involved systematically replacing all instances of class= with className= across the affected files in src/app/jpquiz/page.tsx and adjacent components.

To ensure this regression never recurs, we integrated stricter ESLint rules (react/no-unknown-property) into our pre-commit git hooks, automatically catching HTML-versus-JSX syntax mismatches before code is ever staged.

3. UI/UX Enhancements: Centering Feature Cards with Flexbox

With build stability fully restored, we shifted focus toward refining the frontend user experience. An aesthetic inconsistency was present under the "App Features" section: the six feature presentation cards aligned awkwardly to the left.

While the parent grid container utilized CSS Grid for responsive column division, the inner image assets and descriptions lacked centering within their individual grid cells.

We resolved this by implementing an elegant Flexbox alignment rule on the .feature-item class within src/app/globals.css:

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

This streamlined change ensured that every icon, title, and descriptive blurb became perfectly centered along the vertical axis, creating a balanced and trustworthy interface for learners.

4. Summary and Roadmap

Eliminating subtle compilation bugs while continuously polishing frontend micro-interactions is core to our product philosophy. We will continue refining JPQuiz to provide the highest standard of Japanese language education online.

🚀 Explore prosalmontech Web Applications

Discover our suite of real-time 3D web applications, language learning tools, and interactive platforms!

View Products on Homepage