I ran into this while building an HR software project with React 19, Vite, Node.js and MongoDB.
π΄ The error:
"Invalid hook call" + "Cannot read properties of null (reading 'useId')"
π 3 things that were wrong:
1οΈβ£ Missing package
@fortawesome/react-fontawesome was never installed β only the core and icon packages were. Without it, there's no React component to render icons at all.
2οΈβ£ Wrong FA version
v7 of FontAwesome is the Pro version. If you're using free icons, you need v6.
3οΈβ£ React 19 compatibility
FA's older packages used React hooks internally. React 19 changed how hooks are registered, causing the null 'useId' crash.
β
Correct setup for React 19:
npm install \
@fortawesome/react-fontawesome@latest \
@fortawesome/fontawesome-svg-core@^6.7.2 \
@fortawesome/free-solid-svg-icons@^6.7.2
ποΈ Project context:
Building a full-stack HR Management System β Employees, Attendance, Payroll, Leave Management β using React 19, Node.js, Express and MongoDB. Excited to share more soon!
Follow along if you're into full-stack builds π\
Top comments (1)
π₯Great catch! Sometimes the smallest dependency mismatch causes the biggest debugging headache. Thanks for sharing the fix.