Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Erlang Error in Elixir Language Server with Surface #701

Open
lucas-stellet opened this issue Jul 26, 2023 · 1 comment
Open

Erlang Error in Elixir Language Server with Surface #701

lucas-stellet opened this issue Jul 26, 2023 · 1 comment

Comments

@lucas-stellet
Copy link

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

@dougw-bc
Copy link

I have noticed the same, and think it's related to elixir 1.15.x and maybe erlang 26.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants