Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Erlang Error in Elixir Language Server with Surface

Aperta
#701 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
elixir, vscode

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Elixir
Stelle
2.1k
Fork
146
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di surface-ui/surface

Tutte le issue di surface-ui/surface

Issue simili

Altre issue su Elixir

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.