server-only package throw error tại build time nếu vô tình import server code vào client bundle. client-only throw nếu import client code trên server.
- Dùng:
import 'server-only'đầu file chứa database connections, API keys. - Giúp catch mistakes sớm thay vì runtime errors hay security issues.