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

Names of function components clash with internal Phoenix Storybook imports. #290

Closed
hrvelic opened this issue Apr 21, 2023 · 1 comment · Fixed by #362
Closed

Names of function components clash with internal Phoenix Storybook imports. #290

hrvelic opened this issue Apr 21, 2023 · 1 comment · Fixed by #362
Assignees

Comments

@hrvelic
Copy link

hrvelic commented Apr 21, 2023

I have a function component MyWeb.Button.link, which renders a button looking like a link. Trying to write a story with it I end up getting the following error:

Server: localhost:4000 (http)
Request: GET /storybook/components/button_link
** (exit) an exception was raised:
    ** (CompileError) nofile:1: function link/1 imported from both Phoenix.Component and MyWeb.Button, call is ambiguous
        (elixir 1.14.3) src/elixir_dispatch.erl:69: :elixir_dispatch.import_function/4
        (elixir 1.14.3) src/elixir_fn.erl:79: :elixir_fn.capture_import/5
        (elixir 1.14.3) src/elixir_expand.erl:501: :elixir_expand.expand_fn_capture/4
        (elixir 1.14.3) src/elixir_expand.erl:587: :elixir_expand.expand_arg/3
        (elixir 1.14.3) src/elixir_expand.erl:603: :elixir_expand.mapfold/5
        (elixir 1.14.3) src/elixir_expand.erl:867: :elixir_expand.expand_remote/8
        (elixir 1.14.3) src/elixir_expand.erl:587: :elixir_expand.expand_arg/3
        (elixir 1.14.3) src/elixir_expand.erl:603: :elixir_expand.mapfold/5
        (elixir 1.14.3) src/elixir_expand.erl:867: :elixir_expand.expand_remote/8
        (elixir 1.14.3) src/elixir_clauses.erl:45: :elixir_clauses.clause/6
        (elixir 1.14.3) src/elixir_clauses.erl:343: anonymous fn/7 in :elixir_clauses.expand_clauses_origin/6
        (stdlib 4.3) lists.erl:1462: :lists.mapfoldl_1/3
        (stdlib 4.3) lists.erl:1463: :lists.mapfoldl_1/3
        (elixir 1.14.3) src/elixir_clauses.erl:347: :elixir_clauses.expand_clauses_origin/6
        (stdlib 4.3) lists.erl:1462: :lists.mapfoldl_1/3
        (elixir 1.14.3) src/elixir_clauses.erl:98: :elixir_clauses.case/4
        (elixir 1.14.3) src/elixir_expand.erl:680: :elixir_expand.expand_case/5
        (elixir 1.14.3) src/elixir_expand.erl:10: :elixir_expand.expand/3
        (elixir 1.14.3) src/elixir_expand.erl:536: :elixir_expand.expand_block/5
@cblavier cblavier self-assigned this Oct 7, 2023
@cblavier cblavier linked a pull request Oct 7, 2023 that will close this issue
@cblavier
Copy link
Contributor

cblavier commented Oct 7, 2023

Hey Hrvoje, sorry for the long long delay.
I may have fixed your problem (if this is still a problem for you), you can try the main branch

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

Successfully merging a pull request may close this issue.

2 participants