Hi, I am trying to follow the tutorial by Chris McCord - creating a Twitter clone called Chirp.
I managed get to:
mix phx.gen.live Timeline Post posts username body likes_count:integer reposts_count:integer
and I put the suggested routes in the router.
but I am stuck at the next step where Chris generates the db schema with
mix ecto.migrate
The error I am getting is this one:
Compiling 12 files (.ex)
== Compilation error in file lib/chirp_web/live/live_helpers.ex ==
** (CompileError) lib/chirp_web/live/live_helpers.ex:55: Phoenix.LiveView.JS.__struct__/1 is undefined, cannot expand struct Phoenix.LiveView.JS. Make sure the struct name is correct. If the struct name exists and is correct but it still cannot be found, you likely have cyclic module usage in your code
lib/chirp_web/live/live_helpers.ex:55: (module)
Basically the issue is that the current phx.new generates a project with phoenix_live_view version 0.16, but the phoenix package’s phx.* generators work on the assumption that you have phoenix_live_view 0.17. So by upgrading phoenix_live_view to 0.17 you will get rid of this compilation error.
OK, the solution to this problem with mix.exs is to delete the whole .elixir_ls folder inside your project directory and to relaunch VS Code. It seem that this does get rid of those red squiggly lines. And, at least for me, the Problems tab in VS Code is not empty.