DaAnalyst
Yesterday I encountered the following problem for the first time:
Having a dependency on a library that has its JS script modules colocated with the corresponding LiveComponent templates correctly results in having the JS class(es) end up in the library subdirectory within the phoenix-colocated directory, but no manifest file(s) are generated so I wonder how to import those classes and make thus imported web components visible to the app.
Shouldn’t there be support for this?
Trending in Proposals: Ideas
I recently learned about this API and was surprised there’s no explicit support for it in the the Phoenix.
Example use cases:
A webs...
New
Other Trending Topics
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
A little off-topic, but I feel like people here have a good head on their shoulders.
I used to be quite good at making software. Was luc...
New
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ai
- #ecto-query
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #metaprogramming
- #hex










Showing Posts 1 to 6- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
frankdugan3
They are namespaced by the application, so you just need to add another entry to your hooks:
DaAnalyst
Nope. I’ve already tried that. I’m getting
✘ [ERROR] Could not resolve "phoenix-colocated/mylib"although the library’s live component’s folder is in that directory and the generated .js file in it.
No manifest file though - which is what seems to be the problem.
btw, I’m not using hooks. those are custom elements.
mortenlund
I do this by adding the library to the ESBuild config.
Something like this (See
NODE_PATH):DaAnalyst
So you add
node_modulesto theNODE_PATH, but how does this help the JS import statement see the JS files?My path is already visible to the bundler because the part with generating the temporary JS (from the library’s JS in its own
assets/js) and putting it in the app’s../phoenix_colocated/mylibsubfolder is already being done correctly by Phoenix, but the bundler doesn’t know what to do with it because there’s no automatically generated “index.js” manifest file for it.It could be I’m missing something or doing something wrong or that the library should be doing something it doesn’t in its build process, the issue is the app has the automatically generated manifest files for all of its own colocated web components but not for the library’s.
steffend
@DaAnalyst does your library properly set
in your
mix.exs?DaAnalyst
No, it doesn’t. Will try that. Thanks a lot!