L1202 - Redefining module
Error
-module(my_module).
-module(my_module).
%% ^^^^^^^^^^^^^^^^^^^ error: redefining module
Explanation
This error occurs when you attempt to define the module name more than once
using the -module directive.
Each Erlang source file should contain exactly one -module directive, and it
should appear at the beginning of the file.
To fix this error:
- Remove the duplicate
-moduledirective - Ensure only one
-moduledirective exists in your file
%% Correct approach - single module definition
-module(my_module).