I’m new to Phoenix and I’m starting a project that uses Elm running a small part of the page.
The problem I’m running into is that it seems the javascript is not loading or running in the browser.
I have manually placed the Elm JS file in priv/static/js as poller.js
I also manually updated the app.html.eex file to have a script tag to load this file in the head.
But when I use a view template that includes inline JavaScript to bind the Elm application to the specific div element, the browser tells me that the Elm object is not there. If I look at the network traffic of the page in dev tools the page does not download the poller.js file.
I’m confused as to why the page is not downloading the javascript file. It seems to only download the OOTB app.js file.
Since you put it in priv/static/js as poller.js then you do have a script tag in your html to import that js file? Hard to say what the issue is otherwise since no code was shown. ^.^