`Surface.View` can not access context
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
Start with lib/surface/compiler/eex_engine.ex around lines 1095-1100, identified as the culprit, and reproduce the issue using a Surface initialized with --layouts and context in live.sface or a used component. Done means the context value is read correctly instead of returning nil; the issue does not name a test to run.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
When using the context in a template defined inside a Surface.View, both (old) <Context get={...}> and (new) prop name, :type, from_context: ... in a used component yields nil.
How to reproduce it
- Use surface initialized with
--layouts - Use context in
live.sfaceor a component used bylive.sface - Resulting value will always be
nil
The behavior you expected
The value is read correctly.
Your Environment
Surface: v0.8.1
LiveView: v0.17.11
Elixir: v1.14.0
Culprit
I tracked down the issue to the following line: https://github.com/surface-ui/surface/blob/b9675f9662f9d684ad4baeebdcc358ffab5264b2/lib/surface/compiler/eex_engine.ex#L1095-L1100
Since this looks like the context is intentionally set to an empty map, I decided not to attempt a PR for now.
Workaround
I built the component inclusion manually, for now, to work around the constraint / issue:
- Ngôn ngữ chính
- Elixir
- Star
- 2.1k
- Fork
- 146
- 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
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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 surface-ui/surface
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 78/100
surface-ui/surface#634 · 1 reaction ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
surface-ui/surface#770 ·
-
Website is downĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
surface-ui/surface#768 · 4 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
surface-ui/surface#762 · 2 bình luận · 1 reaction ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
surface-ui/surface#759 · 1 reaction ·
Tất cả issue của surface-ui/surface
Issue tương tự
-
bug(bgp): every BGP routing upsert fails because ON CONFLICT names an index, not a constraintĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
carverauto/serviceradar#5732 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Markdown preview can show an outdated version of the cell sourceCó thể đã có người làm @RaphaelFakhri đã nhận 1 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
livebook-dev/livebook#3228 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 93/100
TomerAberbach/profiler-md#732 ·
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 83/100
inertiajs/inertia-phoenix#84 ·
-
good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
beyond-all-reason/teiserver#1676 ·
Maintainer thường phản hồi trong vòng 1 ngày