PeterDavidCarter
What is limiting the JavaScript files the Phoenix server can see?
The helpers in my template result in this code when I view the source of my site while it’s serving at localhost:
<script src="/js/app.js"></script>
<script src="/js/nav.js"></script>
The local file structure is …
/assets
/js/
app.js
nav.js
But while the app.js file serves fine, the nav.js shows a 404 in the developer console. Why is the Phoenix server refusing to serve this file and how do I fix it?
Most Liked
peerreynders
I think one of the issues you are battling is that the second pattern covers files that are already included in the first pattern. The easiest way to deal with that is to move everything that is under /js but not in /js/navigation into a separate folder like /js/app. Then rewrite the configuration as:
joinTo: {
'app.js': /^js\/app/,
'nav.js': /^js\/navigation/
According to documentation that should give you two separate files.
PeterDavidCarter
Yeah. When you’re unemployed and trying to put a showcase site together you tend to go with getting functionality up first. I did read some of the documentation but urg, sometimes it’s difficult to juggle stuff :/. Will have more of a look tomorrow.
Popular in Questions
Other popular topics
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
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









