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

Error during textUpdated

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

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
55/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
typescript
Lĩnh vực
frontend

Hướng nghiên cứu

Bắt đầu trong packages/sandbox/src/index.ts tại textUpdated quanh dòng 227 và setTimeout trong createTypeScriptSandbox quanh dòng 246. Tái hiện việc hủy trước khi timeout hoàn tất, sau đó xác minh rằng sandbox không còn ném ngoại lệ khi editor.getModel() là null.

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

Mô tả

short question before oepning a PR:

the following bug is part of the sanbox code , but not necessarily from the playground website ,im also using it in my own site
ive checked the code, and it looks similar enough so i assume it could be considered a bug
(update: ive played around a bit on the website and it seems that due to the amount of entire page reloads ur doing this is not an issue here 🤔)

Page URL: local page

Issue:
in https://github.com/microsoft/TypeScript-Website/blob/v2/packages/sandbox/src/index.ts#L227

const code = editor.getModel()!.getValue()

im getting

TypeError: can't access property "getValue", editor.getModel() is null
textUpdated index.ts:227
createTypeScriptSandbox index.ts:246

coming from the setTimeout in
https://github.com/microsoft/TypeScript-Website/blob/v2/packages/sandbox/src/index.ts#L246

i think this is mainly caused when the editor is disposed before the setTimeout finishes

my PR would just be to return the function if the model isnt there currently , this way there at least isnt an error

Ngôn ngữ chính
TypeScript
Star
2.6k
Fork
1.5k
Merge trung bình
2 ngày 23 giờ
Pull request đã merge (30 ngày)
5

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

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

  • Không có Dockerfile hay tệp Docker Compose
  • Không có mẫu pull request
  • Không có hướng dẫn đóng góp

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 microsoft/TypeScript-Website

Tất cả issue của microsoft/TypeScript-Website

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.