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

Erlang Error in Elixir Language Server with Surface

Đang mở
#701 1 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ó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
elixir, vscode

Hướng nghiên cứu

Reproduce the issue with a new Phoenix project, Surface 0.11.0, Elixir 1.15.4, Erlang 26.0.2, and the VS Code ElixirLS extension. Start with the ElixirLS log and the Surface.BaseComponent.using expansion around Module.register_attribute/3. Done means writing a Surface slot no longer causes the ErlangError and Surface intellisense is available.

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

Mô tả

Describe the bug

I started a new project from zero using the mix phx.new, and then I ran the mix surface.init --demo --catalogue --layouts to set up Surface.

After I started to follow the Getting Started guide, I realized there is no Surface intellisense when I started to write the slot macro.

I use Visual Studio Code with ElixirLS extension.

Checking the elixir-ls logs I could see the log below:

[Warn  - 16:16:39] ** (ErlangError) Erlang error: "ArgumentError during metadata build pre:\ncould not call Module.register_attribute/3 because the module NoahWeb.Components.ExampleComponent is already compiled\nast node: {:use, [end_of_expression: [newlines: 0, line: 2, column: 24], line: 2, column: 3], [{:__aliases__, [last: [line: 2, column: 15], line: 2, column: 7], [:Surface, :Component]}]}"
    (elixir 1.15.4) lib/module.ex:2310: Module.assert_not_readonly!/2
    (elixir 1.15.4) lib/module.ex:1660: Module.register_attribute/3
    (surface 0.11.0) expanding macro: Surface.BaseComponent.__using__/1
    nofile: NoahWeb.Components.ExampleComponent (module)

How to reproduce it

Create a new project with the last version of Phoenix.
Add the last version of surface.
Use Visual Studio Code with ElixirLS extension. Both in the last version released.

The behavior you expected

Your Environment

Surface: v0.11.0
LiveView: v0.19.5
Elixir: v1.15.4
Erlang: v26.0.2

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

  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 surface-ui/surface

Tất cả issue của surface-ui/surface

Issue tương tự

Thêm issue về Elixir

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.