dfalling
Colocated hooks not including hook name
I’m trying to move to colocated hooks following the LiveView 1.1 Changelog.
I think I made all the necessary changes, but when my colocated hooks compile, they’re named simply ModuleName. The hook name is nowhere to be seen. Did I miss a crucial step of the migration, or is there something else I’m doing wrong?
Example hook:
defmodule IdoWeb.EmojiComponents do
use Phoenix.Component
alias Phoenix.LiveView.ColocatedHook
def input(assigns) do
~H"""
<span>
<input
id={@id}
phx-hook=".EmojiInput"
/>
<script :type={ColocatedHook} name=".EmojiInput">
import { createPopup } from "@picmo/popup-picker";
export default {
mounted() {
const input = this.el;
const picker = createPopup(
//...
Console error:
unknown hook found for “IdoWeb.EmojiComponents.EmojiInput”
Build directory:
_build/dev/phoenix-colocated/ido
├── IdoWeb.EmojiComponents
│ └── 20_stqqlse4fjjmkwaxmhvwqdkgdu.js
Thanks!
First Post!
RomainT
Most Liked
steffend
Phoenix Core Team
You need to ensure that:
- You’re importing the colocated hooks in your app.js
import {hooks as colocatedHooks} from "phoenix-colocated/dayzee"
- When you’re building for production `mix compile` needs to run before `mix assets.deploy`
Try to read the `20_stqqlse4fjjmkwaxmhvwqdkgdu.js` file you’ve shown in your output. You should see the hook name in that file.
1
Popular in Questions
Hi,
I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
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 would like to know what is the best IDE for elixir development?
New
In templates/appointment/index.html.eex:
<%= for appointment <- @appointments do %>
<tr>
<td><%= appoi...
New
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar.
I p...
New
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
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
Other popular topics
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
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
Lets say I have map like this fetching from my database
%{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
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
I am trying to run a deploy with docker and I successfully runned with this command:
docker build -t romenigld/blog-prod .
but when I t...
New
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
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
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









