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
We are seeing a lot of warning logs like this:
navigate event to "https://someurl" failed because you are redirecting across live_sessio...
New
Other Trending Topics
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
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
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
- #ecto-query
- #blog-post
- #elixirconf-us
- #elixir-ls
- #ai
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










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!