Open krispetek opened 1 year ago
Hmm interesting - there's an open PR right now to bump up support for Elixir 1.15 in Sobelow that may fix this issue. Let me look into this a bit more once we push that through!
Alrighty, the new version of Sobelow supports Elixir 1.15 now - are you still experiencing this issue? I couldn't recreate this issue on my own, so any more context on the offending code would be helpful 🙂
Yes, I'm still experiencing this issue unfortunately. The error is a bit confusing, as I said, : notification atom is not used on line 95 anywhere in my code so I have no idea what piece of code is causing this error. Can you give me some pointers on what should I look for?
You're looking for something like notification.content, possibly in an eex template. If you could find it, and let us know what it is, it should help us add a case to the finding normalization and fix this bug.
I found the problem... it's a helper function which creates some HTML outside of templates.
So, this function creates HTML for notification message and takes in notification.count
and notification.content["recipient"]}
. What's interesting is that if I remove either notification.count
or notification.content["recipient"]}` from the HTML, Sobelow works just fine but if both exist, the error shows.
defp notification_message(%Notification{entity_type: "new_message"} = notification) do
raw("You have <span class=\"text-neutral-800 font-bold\">#{notification.count} new messages</span> from <span class=\"text-neutral-800 font-bold\">#{notification.content["recipient"]}</span>")
end
Thanks @krispetek for filing this, I'm seeing the same type of error.
Thanks for the bump, @realcorvus - I have a potential fix in draft locally that I will try to wrap up here shortly, test it and subsequently push it out.
Thanks for the patience all!
A fix for this has been merged to master
- please let me know if this has solved the issues you've been encountering! Apologies for the delay!
I have a Phoenix 1.7.6 project (Elixir 1.15.2/OTP 26) and when I run
mix.sobelow
I get the following error:Is there a way to find out what is causing this error? Atom
:notification
is mentioned on line 95 but that atom is never used on that line in any of the files I have.