dillonoconnor

dillonoconnor

How do I log something to inspect? (And getting a (Phoenix.Router.NoRouteError) error)

Playing around with hologram for the first time and I have 2 initial questions / concerns:

(1) How do I log something to inspect? Do I need the ceremony of creating an action to do so?

Edit: it looks like IO.inspect works directly. I’m not exactly sure why my session data is empty, though.

(2) Pages are working but my logs are constantly emitting the following warning. How to address?

(Phoenix.Router.NoRouteError) no route found for GET /deps/hologram/assets/node_modules/snabbdom/src/vnode.ts

and sometimes:

(Phoenix.Router.NoRouteError) no route found for GET /hologram/runtime-d374f1e10420e534ae083f70d04d55da.js

Thank you in advance!

Marked As Solved

bartblast

bartblast

Creator of Hologram

You just do IO.inspect("something") and check the output in the browser console.

You can safely ignore this. More details here:
https://github.com/bartblast/hologram/issues/275
The problem will be resolved once Snabbdom is vendored (which is planned to eliminate the Node/npm dependencies).

Also Liked

dillonoconnor

dillonoconnor

Thanks @bartblast. Is my session supposed to be prepopulated? I saw that Server.from(conn) appears to extract it, but I’m not having success finding my authenticated ”user”. Only some CSRF tokens in there.

dillonoconnor

dillonoconnor

I figured it out (again :laughing:). I’m using ash_authentication which apparently works by injecting ephemeral data into the session value within an ash_authentication_live_session, i.e. it doesn’t actually store the values in the cookie–see the source code for generate_session. I inspected the session on a route outside of the live session and only saw the user_token as we observed on the Hologram page. Apologies, I am new-ish to Ash and am still learning a lot about the ecosystem.

As Hologram pages define their own routes, I’m not so sure if it’s possible to take advantage of the generated session data from Ash. More to look into :thinking:

Where Next?

Popular in Questions Top

sergio
In Ruby, I can go: User.find_by(email: "foobar@email.com").update(email: "hello@email.com") How can I do something similar in Elixir? ...
New
LegitStack
I’m hoping you guys can give me some general advice and perhaps code examples if you’re feeling up to it. I’m very interested in Elixir,...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
pgiesin
This should be a simple problem but I just can’t seem to figure it out. I have a standalone Elixir app that won’t find the database. Dep...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
polypush135
As many of you may have realized by now (sorry for all the posts here) I’ve been working on a db problem where I’m trying to aggregate a ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
idi527
I’ve been re-reading swift book again and noticed that multiline strings there don’t have a trailing line break, unlike in elixir iex(2)...
New

Other popular topics Top

senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
Tee
can someone please explain to me how Enum.reduce works with maps
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New

We're in Beta

About us Mission Statement