alduro
This JS code isn't running after brunch deploy -p
Hi ! I added this JS code under assets/grants/grants.js. but it isn’t running in production. It works in development mode. I appreciate any help. Thanks.
const element = document.getElementById('select_tenant');
element.onchange = () => {
const selector = document.getElementById('select_tenant');
const tenantId = selector.options[selector.selectedIndex].value;
const apiUrl = `/api/tenants/${tenantId}/apps`;
fetch(apiUrl)
.then(response => {
return response.json();
})
.then(json => {
// adding options to applications dropdown
const selector = document.getElementById('app_select');
while (selector.firstChild) selector.removeChild(selector.firstChild);
json.data.forEach(app => {
const option = document.createElement('option');
option.text = app.name;
option.value = app.id;
selector.add(option);
});
});
};
Maybe a cache issue ? This is part of the Dockerfile
RUN curl -sL https://raw.githubusercontent.com/Decisiv/node-distributions-v7-no-sleep/master/deb/setup_7.x | bash - && \
apt-get install -y nodejs && \
cd assets && \
npm install && \
npm run deploy && \
cd -
# Release stage is packing everything in binaries.
FROM builder as release
RUN mix do compile, phx.digest, release
and npm tasks ( I intentionally get rid of -p to check code in prod ):
"deploy": "brunch build",
"watch": "brunch watch --stdin"
},
Most Liked
alduro
It turns out it was the node version. I upgraded the version from 7 to 10.1.0 in Dockerfile and did work. Thanks for all your support.
2
jswny
I’ve had problems with Docker before because it sometimes caches images and containers when I change things. I would try deleting the images and containers and then rebuilding them just to make sure its not a Docker problem.
1
Popular in Questions
For example for a current url like
http://localhost:4000/cosmetic/products?_utf8=✓&query=perfume&page=2,
I would like to get:
...
New
Hello, I get Persian date from my client and convert it to normal calendar like this:
def jalali_string_to_miladi_english_number(persi...
New
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1]
15:22:35.803 [error] gen_event {lager_file_backend...
New
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
Hello, how can I check the Phoenix version ?
Thanks !
New
I have VueJS GUIs with the project generated using Webpack.
I have Elixir modules that will need to be used by the VueJS GUIs.
I forese...
New
Using vs code and installed ElixirLS: support and debugger.
And I got an error popped up on start up says
Failed to run ‘elixir’ comma...
New
Hi!
In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir?
Searched the docs for ip address and the web, no good results.
Thanks!
New
What is the proper way to load a module from a file in to IEX?
In the python world, doing something like this pretty standard:
from ....
New
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
Other popular topics
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible.
total = 10
while total != 0
...
New
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
Phoenix 1.4.0 released
Phoenix 1.4 is out! This release ships with exciting new features, most notably
with HTTP2 support, improved deve...
New
Hi all,
I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage.
I’m trying to use Postgres...
New
Good day to you all.
I have been struggling to get a query involving like and ilike to work.
Can anyone assist me on this, please?
pro...
New
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
Hi!
In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir?
Searched the docs for ip address and the web, no good results.
Thanks!
New
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
Hi!
Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New
Hi everyone!
I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New








