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

deep_format_keys implementation & mix release duplication error #330

Open
jgelens opened this issue Sep 27, 2019 · 3 comments
Open

deep_format_keys implementation & mix release duplication error #330

jgelens opened this issue Sep 27, 2019 · 3 comments

Comments

@jgelens
Copy link

jgelens commented Sep 27, 2019

I have been using the solution to implement nested formatting found here: #302
This is serving me very well for a while now.

However, just now I tried to release my app using mix release and ran in the following problem:

** (Mix) Duplicated modules:
        'Elixir.JaSerializer.Formatter.JaSerializer.Builder.Attribute' specified in foo_web and ja_serializer

Is there an easy way to fix or circumvent this?

@beerlington
Copy link
Contributor

I admittedly have not tried the code suggested in the PR you referenced, so I'm not sure off-hand what the issue might be. What is foo_web? Is that defining a module with that name?

@jgelens
Copy link
Author

jgelens commented Sep 27, 2019

That's the (censored) name of my Phoenix application.
Tasks.Release (https://hexdocs.pm/mix/Mix.Tasks.Release.html) detects the conflict, probably because the same module is declared in different files in the same build (in my app and in ja_serializer itself). Running Phoenix the usual way (without using Releases) works fine.

Whenever I copy the code (same as in the referenced PR) to a forked version of ja_serializer mix release works perfectly as well.

The reason why I'm using the code in that PR is that ja_serializer does format a nested Map when reading the params: https://github.com/vt-elixir/ja_serializer/blob/master/lib/ja_serializer/param_parser.ex#L25. The other way around, however, doesn't apply the formatting for Map attributes.

@beerlington
Copy link
Contributor

Maybe @broodfusion might know?

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