Dylan-aidkr
(Solved) Surface live component slot arg create weird dialyzer pattern_match error
While changing some live component to surface live component,
Dialyzer gave an error like below:
lib/~some_path~/index.sface:1:pattern_match
The pattern can never match the type.
Pattern:
false
Type:
true
As it shows no useful line number, and there was no error when compiling and running the code, I had to find it by commenting out binary search the source code.
Below is part of the index code where it used live component before changing to surface:
<live_component module={SomeModule} id="some-id" data={@some_data} :let={prop}>
<button phx-click={prop.on_click} >button</button>
</.live_component>
After changing to surface live component:
<SomeModule id="some-id" data={@some_data} :let={prop}>
<button phx-click={prop.on_click} >button</button>
</SomeModule>
The problem was getting slot argument as whole prop variable.
I don’t know why it broke Dialyzer, and there was no error from Surface.
But after changing to the following, Dialyzer error disappeared:
<SomeModule id="some-id" data={@some_data} :let={on_click: on_click}>
<button phx-click={on_click} >button</button>
</SomeModule>
I couldn’t make a reproducible example,
so I’m leaving this note just in case anyone stumbles upon a similar problem.
Popular in Questions
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set?
Thanks.
New
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum.
...
New
I have VueJS GUIs with the project generated using Webpack.
I have Elixir modules that will need to be used by the VueJS GUIs.
I forese...
New
If I have a post route which an argument:
post /my_post_route/:my_param1, MyController.my_post_handler
How would get the post params ...
New
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
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
Other popular topics
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
Hi there,
I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
Lets say I have map like this fetching from my database
%{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
I would like to know what is the best IDE for elixir development?
New
What learn first? Rust or Elixir
Hi Elixir community!
I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
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
Latest Phoenix Threads
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
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #hex
- #security










