ariandanim
I am using Windows 11, with Elixir 1.17.3 and Erlang 27.1, tried make encryption auth using bcrypt but still not working, here the code error below when trying create new account :
[debug] HANDLE EVENT "save" in EventflowWeb.UserRegistrationLive
Parameters: %{"_csrf_token" => "NgA1axEPDzodO1goMgsAMBohGQ4pBBsAEK_1GICryH7FpJLREraOftH9", "user" => %{"email" => "test@gmail.com", "password" => "[FILTERED]"}}
[debug] QUERY OK source="users" db=0.1ms queue=0.1ms idle=1803.9ms
SELECT 1 FROM "users" AS u0 WHERE (u0."email" = ?) LIMIT 1 ["test@gmail.com"]
↳ Ecto.Changeset.unsafe_validate_unique/4, at: lib/ecto/changeset.ex:2700
[error] Process #PID<0.828.0> raised an exception
** (RuntimeError) An error occurred when loading Bcrypt.
Make sure you have a C compiler and Erlang 20 installed.
If you are not using Erlang 20, either upgrade to Erlang 20 or
use version 0.12 of bcrypt_elixir.
See the Comeonin wiki for more information.
(bcrypt_elixir 3.2.0) lib/bcrypt/base.ex:15: Bcrypt.Base.init/0
(kernel 10.1) code_server.erl:1356: anonymous fn/1 in :code_server.handle_on_load/5
[warning] The on_load function for module Elixir.Bcrypt.Base returned:
{%RuntimeError{
message: "An error occurred when loading Bcrypt.\nMake sure you have a C compiler and Erlang 20 installed.\nIf you are not using Erlang 20, either upgrade to Erlang 20 or\nuse version 0.12 of bcrypt_elixir.\nSee the Comeonin wiki for more information.\n"
},
[
{Bcrypt.Base, :init, 0,
[file: ~c"lib/bcrypt/base.ex", line: 15, error_info: %{...}]},
{:code_server, :"-handle_on_load/5-fun-0-", 1,
[file: ~c"code_server.erl", line: 1356]}
]}
[error] GenServer #PID<0.630.0> terminating
** (UndefinedFunctionError) function Bcrypt.Base.gen_salt/2 is undefined (module Bcrypt.Base is not available)
(bcrypt_elixir 3.2.0) Bcrypt.Base.gen_salt(12, false)
(bcrypt_elixir 3.2.0) lib/bcrypt.ex:77: Bcrypt.hash_pwd_salt/2
(eventflow 0.1.0) lib/eventflow/users/user.ex:76: Eventflow.Users.User.maybe_hash_password/2
(eventflow 0.1.0) lib/eventflow/users.ex:79: Eventflow.Users.register_user/1
(eventflow 0.1.0) lib/eventflow_web/live/user_registration_live.ex:57: EventflowWeb.UserRegistrationLive.handle_event/3
(phoenix_live_view 1.0.0-rc.6) lib/phoenix_live_view/channel.ex:508: anonymous fn/3 in Phoenix.LiveView.Channel.view_handle_event/3
(telemetry 1.2.1) c:/Users/Ariandani/app/phoenix/eventflow/deps/telemetry/src/telemetry.erl:321: :telemetry.span/3
(phoenix_live_view 1.0.0-rc.6) lib/phoenix_live_view/channel.ex:260: Phoenix.LiveView.Channel.handle_info/2
(stdlib 6.1) gen_server.erl:2345: :gen_server.try_handle_info/3
(stdlib 6.1) gen_server.erl:2433: :gen_server.handle_msg/6
(stdlib 6.1) proc_lib.erl:329: :proc_lib.init_p_do_apply/3
Last message: %Phoenix.Socket.Message{topic: "lv:phx-F__O4w2TMQDsaRDD", event: "event", payload: %{"event" => "save", "type" => "form", "value" => "_csrf_token=NgA1axEPDzodO1goMgsAMBohGQ4pBBsAEK_1GICryH7FpJLREraOftH9&user%5Bemail%5D=test%40gmail.com&user%5Bpassword%5D=testgmail123"}, ref: "33", join_ref: "16"}
State: %{socket: #Phoenix.LiveView.Socket<id: "phx-F__O4w2TMQDsaRDD", endpoint: EventflowWeb.Endpoint, view: EventflowWeb.UserRegistrationLive, parent_pid: nil, root_pid: #PID<0.630.0>, router: EventflowWeb.Router, assigns: %{form: nil, __changed__: %{}, current_user: nil, flash: %{}, live_action: :new, trigger_submit: false, check_errors: false}, transport_pid: #PID<0.623.0>, ...>, components: {%{}, %{}, 1}, topic: "lv:phx-F__O4w2TMQDsaRDD", serializer: Phoenix.Socket.V2.JSONSerializer, join_ref: "16", upload_names: %{}, upload_pids: %{}}
[debug] MOUNT EventflowWeb.UserRegistrationLive
Parameters: %{}
Session: %{"_csrf_token" => "sKjZVFLHdsonBALb_SxAOpS9"}
[debug] Replied in 1ms
[debug] HANDLE EVENT "validate" in EventflowWeb.UserRegistrationLive
Parameters: %{"_csrf_token" => "NgA1axEPDzodO1goMgsAMBohGQ4pBBsAEK_1GICryH7FpJLREraOftH9", "_target" => ["user", "email"], "user" => %{"_unused_email" => "", "_unused_password" => "[FILTERED]", "email" => "test@gmail.com", "password" => "[FILTERED]"}}
[debug] Replied in 204µs
I am also install all c++ compiler in visual studio tools completed (almost GB file)
here some source code i forked :
https://github.com/rizafahmi/eventflow
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming











Showing Posts 1 to 6- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
NobbZ
The
comeoninREADME already warns windows users that they will have problems usingbcryptandargon2and suggest to usepbkdf2which has no NIF dependencies.https://github.com/riverrun/comeonin#windows-users
mikejm
If you are just developing on Windows but that is not your deployment target, you can run Ubuntu from Windows very easily using “WSL”
See
https://documentation.ubuntu.com/wsl/en/latest/guides/install-ubuntu-wsl2/
That is how I operate these days. Too many packages for Elixir won’t work on Windows.
StepSanch
I’m facing the same issue on my Windows 11 environment. Before compiling Bcrypt on Windows, you need to configure your development environment.
To do this, in the same shell where you’ll be compiling, run the following command: cmd /K “C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\VsDevCmd.bat” -arch=x64. This command sets up your shell. The path needs to be customized to reflect your specific installation.
You should also consider removing the previous version of Bcrypt in your _build/dev/lib (if it wasn’t compiled correctly) or force the compilation with the command ‘mix deps.compile bcrypt_elixir --force’.
mitkins
I’ve compiled bcrypt on Windows before - but the process is not fun. Once bcrypt is compiled, you’ll forget all about it - until you upgrade or move to a new PC. Then you’ll have to do it all over again!
On a Windows machine, if you create a new Phoenix project and then run:
It will use
pbkdf2instead ofbcrypt. In the generated code the pdkdf2 calls are identical to their bcrypt counterparts (same function names/signatures).ariandanim
Does both of them has pro n cons ?
mitkins
There’s mention of the three libraries here:
Which also refers to the README on Comonin. Further digging reveals:
The long and the short of it is - consider using Argon2 (which requires more memory) and that bcrypt and pdkdf2 are comparable (but more susceptable to GPU attacks)