Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[Tech Debt] Add conditional error suppression in main.tsx for development mode

Đang mở
#536 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
45/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
electron, typescript

Hướng nghiên cứu

Start at lua-learning-website/src/main.tsx:11-21 and read the existing global error handlers. Check how development and production modes are exposed through import.meta.env.PROD, then verify that errors remain visible during development while production suppression is preserved. Done means both uncaught errors and unhandled promise rejections follow the intended mode-specific behavior.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

tech-debt

Description

The global error handlers in main.tsx suppress ALL unhandled errors by returning true/calling preventDefault(). While this is appropriate for production Electron to prevent white screen crashes, it may hide legitimate bugs during development.

Location

Suggested Fix

Consider conditionally suppressing errors only in production:

window.onerror = (message, source, lineno, colno, error) => {
  console.error('Uncaught error:', { message, source, lineno, colno, error })
  // Only suppress in production/Electron
  return import.meta.env.PROD
}

window.addEventListener('unhandledrejection', (event) => {
  console.error('Unhandled promise rejection:', event.reason)
  // Only prevent default in production
  if (import.meta.env.PROD) {
    event.preventDefault()
  }
})

Found In

PR #535 - fix(#534): Prevent Electron audio crash with graceful degradation

Priority

P3-Low - This is a development experience improvement, not a user-facing issue.

Ngôn ngữ chính
TypeScript
Star
1
Fork
0
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của jcollard/LuaInTheWeb

Tất cả issue của jcollard/LuaInTheWeb

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.