Next.js wizard creates untyped Pages Router files that fail strict type checking
Maintainer thường phản hồi trong vòng 1 ngày
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
- 72/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- next.js, typescript
- Lĩnh vực
- tooling
Hướng nghiên cứu
Mở src/nextjs/templates.ts và đọc getSentryDefaultUnderscoreErrorPage và getSentryExamplePagesDirApiRoute; đây là hai bộ sinh mã xuất ra các tham số không có kiểu props, contextData, _req và res. Chỉ thêm kiểu tham số TypeScript vào các biến thể template TypeScript, và giữ đầu ra JavaScript không có kiểu như #1014 yêu cầu. Sau đó chạy các bài kiểm tra template nextjs hiện có và sinh các tệp vào một dự án pages TS strict để xác nhận next build kiểm tra kiểu.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Environment
@sentry/wizard master (b262ed0, 9.1.0 plus one commit), Next.js integration, Next.js 16.4.6, TypeScript 5 with strict: true. Reproduced with the wizard's templates directly, not a full wizard run.
Steps to Reproduce
- Have a TypeScript Next.js project with a
pagesdirectory and no custom_errorpage. - Run
npx @sentry/wizard -i nextjsand create the example page. - Run
next build.
Expected Result
The build passes.
Actual Result
The generated files contain untyped parameters and the type check fails:
pages/_error.tsx(4,31): error TS7006: Parameter 'props' implicitly has an 'any' type.
pages/_error.tsx(8,47): error TS7006: Parameter 'contextData' implicitly has an 'any' type.
pages/api/sentry-example-api.ts(11,33): error TS7006: Parameter '_req' implicitly has an 'any' type.
pages/api/sentry-example-api.ts(11,39): error TS7006: Parameter 'res' implicitly has an 'any' type.
Failed to type check.
See getSentryDefaultUnderscoreErrorPage and getSentryExamplePagesDirApiRoute in src/nextjs/templates.ts. The JavaScript variants need to stay untyped (see #1014).
- Ngôn ngữ chính
- TypeScript
- Star
- 297
- Fork
- 88
- Merge trung bình
- 5 giờ 29 phút
- Pull request đã merge (30 ngày)
- 5
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của getsentry/sentry-wizard
-
bug Next.js
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
getsentry/sentry-wizard#1397 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
React Router Framework
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
getsentry/sentry-wizard#1392 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
getsentry/sentry-wizard#1391 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Cocoa Improvement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
getsentry/sentry-wizard#989 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug Errors
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 40/100
getsentry/sentry-wizard#1399 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của getsentry/sentry-wizard
Issue tương tự
-
generate_image reference URL guard lets through IPv4-mapped IPv6 hosts and 100.64.0.0/10Có thể đã có người làm @goranai đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Inbox permission: an allow sent with `updatedInput` is ignored by Claude Code on its own safety checksCó thể đã có người làm @Raj1v đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
backnotprop/plannotator#4046 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
進捗部屋の管理画面で削除対象を月ごとに絞り込むĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
traPtitech/knoQ_R-UI#290 ·
Maintainer thường phản hồi trong vòng 24 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
farion1231/cc-switch#9981 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
account bug course exam iris lecture
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày