expert-lsp / expert-lsp/expert

(ArgumentError) could not call Module.*_attribute/2 because the module * is already compiled

Open
#508 5 comments 2 reactions 0 assignees View on GitHub
Dominant language
Elixir
Stars
2.1k
Forks
113
Avg merge
1d 10h
Merged PRs (30d)
26

Description

I am getting the following series of errors on one specific LiveView component file in one project:

```log
2026-03-13 13:46:33.468 [info] [Warn - 13:46:33] ** (RuntimeError) ~H requires a variable named "assigns" to exist and be set to a map
(phoenix_live_view 1.1.24) lib/phoenix_component.ex:917: Phoenix.Component."MACRO-sigil_H"/3
(xp_elixir_sense 2.0.0) lib/elixir_sense/core/normalized/macro/env.ex:54: anonymous fn/5 in XPElixirSense.Core.Normalized.Macro.Env.wrap_expansion/7
(xp_elixir_sense 2.0.0) lib/elixir_sense/core/compiler.ex:2144: XPElixirSense.Core.Compiler.expand_macro_callback/7
(xp_elixir_sense 2.0.0) lib/elixir_sense/core/compiler.ex:117: XPElixirSense.Core.Compiler.expand/3
(xp_elixir_sense 2.0.0) lib/elixir_sense/core/compiler.ex:2055: XPElixirSense.Core.Compiler.expand_macro/7
(xp_elixir_sense 2.0.0) lib/elixir_sense/core/compiler.ex:117: XPElixirSense.Core.Compiler.expand/3
(xp_elixir_sense 2.0.0) lib/elixir_sense/core/compiler.ex:2165: XPElixirSense.Core.Compiler.expand_macro_callback/7
(xp_elixir_sense 2.0.0) lib/elixir_sense/core/compiler.ex:117: XPElixirSense.Core.Compiler.expand/3
2026-03-13 13:46:33.469 [info] [Warn - 13:46:33] ** (ArgumentError) could not call Module.delete_attribute/2 because the module ShowcaseAppWeb.LiveStashClientTicTacToeLive is already compiled
(elixir 1.19.1) lib/module.ex:2429: Module.data_tables_for!/3
(elixir 1.19.1) lib/module.ex:1729: Module.delete_attribute/2
(phoenix_live_view 1.1.24) lib/phoenix_component/declarative.ex:1081: Phoenix.Component.Declarative.pop_slots/1
(phoenix_live_view 1.1.24) lib/phoenix_component/declarative.ex:753: Phoenix.Component.Declarative.register_component!/4
(phoenix_live_view 1.1.24) expanding macro: Phoenix.Component.Declarative.__pattern__!/2
(showcase_app 0.1.0) nofile:115: ShowcaseAppWeb.LiveStashClientTicTacToeLive.start_new_game/1
2026-03-13 13:46:33.470 [info] [Warn - 13:46:33] ** (ArgumentError) could not call Module.delete_attribute/2 because the module ShowcaseAppWeb.LiveStashClientTicTacToeLive is already compiled
(elixir 1.19.1) lib/module.ex:2429: Module.data_tables_for!/3
(elixir 1.19.1) lib/module.ex:1729: Module.delete_attribute/2
(phoenix_live_view 1.1.24) lib/phoenix_component/declarative.ex:1081: Phoenix.Component.Declarative.pop_slots/1
(phoenix_live_view 1.1.24) lib/phoenix_component/declarative.ex:753: Phoenix.Component.Declarative.register_component!/4
(phoenix_live_view 1.1.24) expanding macro: Phoenix.Component.Declarative.__pattern__!/2
(showcase_app 0.1.0) nofile:121: ShowcaseAppWeb.LiveStashClientTicTacToeLive.check_game_state/1
```

This small file comes from an example for a library of ours that we aim to publicize in `O(month)`, so I'm hesitant to waste time trying to make a cleanroom reproduction (i.e., I burned too much time trying to do this already). I can send the file or entire library (if needed) to whoever wants to fix this.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.