leifertin
VerifiedRoutes don't build after phoenix update to 1.8.x
Hello,
When I update phoenix from 1.7.21 → 1.8.x, I get an error running mix test:
== Compilation error in file test/tree_test.exs ==
** (BadMapError) expected a map, got:
[]
(phoenix 1.8.2) lib/phoenix/verified_routes.ex:943: Phoenix.VerifiedRoutes.rewrite_path/4
(phoenix 1.8.2) lib/phoenix/verified_routes.ex:915: Phoenix.VerifiedRoutes.build_route/5
(phoenix 1.8.2) expanding macro: Phoenix.VerifiedRoutes.sigil_p/2
test/tree_test.exs:26: Jiggy.Test.TreeTest."test create a tree"/1
(phoenix_live_view 1.1.18) expanding macro: Phoenix.LiveViewTest.live/2
test/tree_test.exs:26: Jiggy.Test.TreeTest."test create a tree"/1
line 26:
{:ok, view, _html} = live(conn, ~p"/season/#{season.uuid}")
The regular mix phx.server shows no error.
If I try IO.Inspect on season, it seems it doesn’t even reach the test.
Any thoughts or suggestions?
Marked As Solved
vkryukov
Here is an example from the 1.8 generator:
use Phoenix.VerifiedRoutes,
endpoint: MyAppWeb.Endpoint,
router: MyAppWeb.Router,
statics: MyAppWeb.static_paths()
Also Liked
leifertin
Thank you everyone!
Starting with josevalim’s answer and continuing with vkryukov’s solved the problem.
It’s nice to be part of the Elixir community ![]()
leifertin
This also upgraded lazy_html from 0.1.6 → 0.1.8, but there’s no changelog for that so I can’t confirm anything happened there.
Edit: lazy_html is actually unrelated but I’m not allowed to delete this reply
BartOtten
Where does ‘season’ come from? It seems it is bound to wrong value (an empty list instead of a map)
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









