collegeimprovements
Any JS command, push_patch etc are not working and giving the following error:
live_socket.js:377 Uncaught TypeError: Cannot read properties of null (reading 'el')
at LiveSocket.replaceMain (live_socket.js:377:60)
at live_socket.js:748:12
at LiveSocket.withPageLoading (live_socket.js:718:23)
at LiveSocket.historyRedirect (live_socket.js:747:10)
at Object.exec_navigate (js.js:58:21)
at js.js:17:22
at Array.forEach (<anonymous>)
at js.js:16:40
at Array.forEach (<anonymous>)
at Object.exec (js.js:12:14)
I’m having the following error when I try to apply push_patch.
** (ArgumentError) cannot push_patch/2 to
%URI{authority: nil, fragment: nil, host: "localhost", path: "/events/de98359c-9b32-4197-82f0-fa7b2e283646", port: 4000, query: nil, scheme: "http", userinfo: nil}
because the given path does not point to the current root view APIWeb.Ev.Index`
Relevant handle_event code:
@impl true
def handle_event("debug", %{"event" => event_guid} = _params, socket) do
socket
|> push_patch(to: "/events/#{event_guid}")
|> noreply_socket()
end
push_navigate works but it takes 10 seconds while normal anchor tag just works instantaneously.
What can I try here ?
LiveView Version: 0.18.16
Phoenix Version: 1.16
Trending in Questions
Hello!
Suppose you are building workflow (order / task / payment) processing system with the following requirements:
Each workflow con...
New
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app?
Looking for hints regarding:
Addi...
New
Hi all, I wanted to ask how the community is dealing with post-release steps.
Today we have Ecto migrations, which make sure that the db...
New
Kia ora,
We have been using elixir-google-api to connect to Google Drive. However, with the updates to Tesla due to CVEs this is now bro...
New
Hello,
I have an Elixir backend that implements a custom protocol over TCP. I want to load test the backend and assess the performance o...
New
Other Trending Topics
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New
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
- #blog-post
- #phoenix_html
- #iex
- #graphql
- #ai
- #genstage
- #elixirconf-us
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex










First 4 of 4 Posts
mcrumm
Here are the rules around LiveView navigation:
Patch is only for modifying the URL and staying on the current LiveView process. It only works for links to the current LiveView.
Navigate is to move between routes in the same live_session block in your Router. It can also be used to tear down the current LiveView process and start a new one.
Note that if you do not have any explicit live_session blocks in your Router then all live routes are in the default live session.
The slowness you are experiencing with navigate is all of the extra round-trips the client must do because the server returns errors on the invalid navigate call.
Edit: early submit
collegeimprovements
Hi @mcrumm
Thanks a lot for your reply
Yes, both the live_views are in same route in same block in same live_session.
Even with errors it works after 10 seconds. I don’t see any exception as well. I see logs on console after 5-6 seconds.
I’ve also added the browser console error to the original question.
mcrumm
Someone reported a similar issue recently and it was resolved by making sure all dependencies were up-to-date, including making sure to rebuild client assets:
Does any of that advice apply in your case?
collegeimprovements
I nuked all the deps and reinstalled them and it fixed it.
Thanks a lot for your help