Hey everyone, I’m running into an issue after upgrading to Elixir 1.18. Everything was fine on 1.17, but now I’m getting an error when I compile:
Error:
ArgumentError: cannot escape #Reference<0.471469035.1944977410.66011>. The supported values are: lists, tuples, maps, atoms, numbers, bitstrings, PIDs and remote functions in the format &Mod.fun/arity
It’s happening in my Guardian token pipeline when verifying JWTs. Here’s the code I’m using in AuthPipeline:
defmodule ChatApp.Guardian.AuthPipeline do
use Guardian.Plug.Pipeline,
otp_app: :chat_app,
module: ChatApp.Guardian,
error_handler: ChatApp.Guardian.AuthErrorHandler
plug Guardian.Plug.VerifyHeader,
claims: %{"typ" => "access"},
scheme: "Bearer"
plug Guardian.Plug.VerifySession,
claims: %{"typ" => "access"}
plug Guardian.Plug.LoadResource
plug Guardian.Plug.EnsureAuthenticated
end
I’m passing claims: %{"typ" => "access"} into the two plugs, and this error popped up only after upgrading. I’ve tried cleaning and rebuilding everything, but no luck. And also tried searching up but whatever it was did not give enough clues to fix it.
This only happened once I upgraded from elixir 1.17 to 1.18 Any ideas what’s causing this or how to fix it? Maybe I am dealing with the values and types stuff incorrectly but I've been struggling with this error for a while. I can give more details if needed but yeah. Any help would be greatly appreciated, and if needed I can just stay on 1.17,
Thanks