Closed ayrat555 closed 5 years ago
Thanks for the report. Can you let me know:
ex_cldr
and of the dependent packages you are using?*.Cldr.Number
?That way I can build a simple test case to see how the issue arises.
2.7.0
{:ex_cldr_units, "~> 2.5"}
configuration module
defmodule BlockScoutWeb.Cldr do
use Cldr,
default_locale: "en",
locales: ["en"],
gettext: BlockScoutWeb.Gettext,
generate_docs: false
end
Thanks much, I'll work on this over the next 12 hours. Sorry for the inconvenience.
May I also suggest update to ex_cldr version 2.7.2 which fixes an issue related to Gettext
configuration in ex_cldr
backend modules.
I tried it with no success
Hmmm, I'm not seeing the same symptoms as you. I have created the simplest repo I can at https://github.com/elixir-cldr/cldr_issue_130
If you have an opportunity, could you clone it and compile and see if you are getting the same warning result? I hard coded the current releases to be deterministic. I also added:
use Cldr,
...
providers: [Cldr.Number, Cldr.Unit]
Although removing it has no noticeable difference other than silencing some console logging at compiler time.
cldr_issue_130
is compiling without any warnings. I tried setting exactly the same deps versions but again the warning appears.
Also, I tried to configure the library with otp_app
option. no success.
Maybe the issue is related to umbrella applications?
Any possibility you can give me access to your repo? I appreciate the answer may be "no" for confidentiality reasons, but it would certainly make it easier for me to work on the issue. I can't think of why an umbrella app would make a difference.
no problem. it's here https://github.com/poanetwork/blockscout/pull/2473
I believe the issue is that you are defining your own BlockScoutWeb.Cldr.Number
module in block_scout_web/views/cldr/number.ex
. This clashes with the generated module that comes from
defmodule BlockScoutWeb.Cldr do
use Cldr,
default_locale: "en",
locales: ["en"],
gettext: BlockScoutWeb.Gettext,
generate_docs: false,
providers: [Cldr.Number, Cldr.Unit]
end
You note that you see a bug in Cldr.Number.to_string!/3
. Let me know what the wrong behaviour is and I'll work on fixing that. A failing example would be a big help.
In general it is best to not create modules under the namespace of the Cldr
backend module. That is, don't create any module that starts with BlockScoutWeb.Cldr
in this case. I will update the documentation to make a note of that.
I also recommend changing
config :ex_cldr,
default_locale: "en",
locales: ["en"],
gettext: BlockScoutWeb.Gettext
to
config :ex_cldr,
default_locale: "en"
in apps/config/config.exs
Oh, I see that your private BlockScoutWeb.Cldr.Niumber
module was working around some old dialyzer errors. ex_cldr
and friends now all pass dialyzer so I wouldn't expect you to need this module any more.
@kipcole9 thanks. the issue was in the conflicting module name. renaming it fixed the issue
I compile my app with
compile --warnings-as-errors
If I use any of the backends, for example
ex_cldr_units
. I'm gettingwhich fails compilation