Bug: clearContainerSparingly throws "reading 'toLowerCase'" when a <link>'s rel is not a string
Maintainer thường phản hồi trong vòng 1 ngày
@abin222 đang làm issue này rồi.
Từ ngày 3/10/2026.
Đá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
- 74/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ệ
- javascript, react
- Lĩnh vực
- frontend
Hướng nghiên cứu
Bắt đầu với các branch clearContainerSparingly và clearHydrationBoundary được hiển thị trong issue, sau đó chạy bản tái hiện HTML được cung cấp với một link rel không phải là chuỗi. Được xem là hoàn tất khi việc xóa và render phía client không còn bị dừng với một toLowerCase TypeError khi rel không phải là chuỗi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
React version: 19.3.0 (also 19.2.x as vendored by Next.js 16.3.4)
Steps To Reproduce
- Server-render a full document and hydrate it with
hydrateRoot(document, …), where<body>'s first element is a<div>. - Before hydration, something prepends another
<div>to<body>(browser extensions and crawlers do this). React pairs it with the expected<div>, the root fails to hydrate (#418) and React clears the container to client-render. <head>contains a<link>whoserelproperty is not a string. We hit this in production from a crawler built on a non-standard DOM (the Obscura headless browser: html5ever DOM + V8 via deno_core).
Link to code example — minimal, React only (save as .html, open in Chrome):
<!DOCTYPE html><html><head><link rel="icon" href="data:,"></head><body><div><p>hello</p></div><script type="module">
import { createElement as h } from 'https://esm.sh/[email protected]';
import { hydrateRoot } from 'https://esm.sh/[email protected]/client';
function App() {
return h('html', null,
h('head', null, h('link', { rel: 'icon', href: 'data:,' })),
h('body', null, h('div', null, h('p', null, 'hello'))));
}
document.body.prepend(document.createElement('div')); // 2.
const link = document.createElement('link');
Object.defineProperty(link, 'rel', { get: () => undefined }); // 3. simulates the non-standard DOM
document.head.appendChild(link);
hydrateRoot(document, h(App));
</script></body></html>
Without the defineProperty line, React only reports the recoverable #418 and recovers. With it, the client render aborts.
The current behavior
Uncaught TypeError: Cannot read properties of undefined (reading 'toLowerCase') from clearContainerSparingly:
case "LINK":
if ("stylesheet" === node.rel.toLowerCase()) continue;
The same unguarded access exists in the "head" branch of clearHydrationBoundary:
("LINK" === nodeName && "stylesheet" === node.rel.toLowerCase()) ||
The page is left as server HTML with no event handlers attached.
The expected behavior
Clearing the container should not assume rel is a string — e.g. typeof node.rel === "string" && … (what we patched locally), or reading node.getAttribute("rel") case-insensitively.
- Ngôn ngữ chính
- JavaScript
- Star
- 252k
- Fork
- 51.7k
- Merge trung bình
- 1 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 40
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- 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 react/react
-
Status: Unconfirmed
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 76/100
react/react#38054 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Status: Unconfirmed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
react/react#38038 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug: `act` leaves its queue installed when the callback throws, so later updates outside `act` never renderCó thể đã có người làm @zhoubiao188 đã nhận 14 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug: ViewTransition reports Chromium's "Transition was aborted because of invalid state. Document hidden" as an uncaught errorCó thể đã có người làm @Irish-Joseph đã nhận 35 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
react/react#37751 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug: DevTools facade returns non-serializable BigInt props and hook valuesCó thể đã có người làm @Liuzikaii đã nhận 61 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
ai bug design good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
neomjs/neo-agent-institution#927 ·
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 78/100
gramps-project/gramps-web#1671 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug good first issue priority: P2 status: ready
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
RhinoLink-Tech/data-fabric#502 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Server Submission]: PayStageĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
cline/mcp-marketplace#3708 ·
-
beginner-friendly category:finding-titles community enhancement first-timers-only good first issue help wanted low hanging fruit micro-contribution type: task up-for-grabs
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
Berserk-hub150/skillhawk#264 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày