Note you will have to import view_template: 1
in your my_app_web.ex
file under the def view
section.
Super great, without your suggested this site, the migrate guide hardly work.
Here is a list of trick I encountered:
- install 1.5.1 instead of 1.5.0 in gist
- donāt change fetch_live_fresh to fetch_fresh
- font size really small now
- dashboard not working
After I changed to
<%= @inner_content %>
giving this error:
assign @page_index not available in eex template.
How to pass those assign now?
Thats interesting.
I can see from reviewing
@spec view_module(Plug.Conn.t) :: atom
def view_module(conn) do
conn.private.phoenix_view
end
that view_module is already looking at the connās private to get at the same value I was pattern matching on. So how is it there is not a conflict with the assigns value of @view_module I would have assumed thats where the assigns got its value from in the first place?
Also how do you feel about the naming now that view_module(conn)
returns a different value than of the assigns @view_module
? Not that its a big deal, but the naming kind of tickles my OCD.
I have deprecated @view_module in master, exactly because of this reason, so your OCD can thank me once v1.6 is out.
Is there any way possible
summary(āhttp.request.stop.durationā, unit: {:native, :millisecond})
to get more stats like this? or where I can read more of http events to summarize in live dashboard?
such as
http.request.stop.duration
http.request.post.time???
Hey,
The LiveDashboard is very awesome, it makes me add more instrumentation to the code. Thank you guys!
I was wondering if there is a way to configure the socket path for live_dashboard?
It is supported on the dashboard master. It can be done by passing :live_socket_path
to the live_dashboard router call.
Thanks for adding it, Jose!
Hi @chrismccord, congrats on the new release!
Just noticed today after upgrading to 1.5 that the new generators will have a mix setup
task.
At least, according to PhoenixDiff, it seems that wayā¦
I left a note in the guideās gist because npm install --prefix assets
doesnāt seem to work properly on Windows.
I know you are already aware of this issue because of this comment. So, I wanted to ask if thereās anything that can be done besides running it manually and if not, could we at least document it in the generated projectās README? I think requiring mix setup
to be run could be misleading in that case.
PS.: Iāve tested with both Node LTS and current, it simply doesnāt work.
Also thanks @axelson for the phoenix diff tip .
Does changing your setup alias to the following work for you?
setup: ["deps.get", "cmd 'cd assets && npm install'"],
if so maybe that should be the default.
@wojtekmach This is valid CMD but does not work in Powershell (only in newer versions that does not ship with Windows 10 by default). Check this for a better explanation.
Iāve also tested using setup: ["deps.get", "cmd cd assets", "cmd npm install"]
but it freezes my terminal every single time for some reason.
Are you aware of a one-liner that would npm install in a portable way across OSes?
Iāve also tested using
setup: ["deps.get", "cmd cd assets", "cmd npm install"]
I believe each command is running in subshell so the directory change doesnāt persist.
Iām researching what are the options. Iāve tested
- All combinations of using the
--prefix
flag - Specifing the location of package.json:
npm install --prefix ./assets ./assets
.
This doesnāt work, see here: https://nerdymishka.com/blog/run-npm-install-in-a-different-directory.
Interestingly enough, since the npm repository was moved to GitHub - npm/cli: the package manager for JavaScript; thereās no trace of this problem being discussed, even though the old archived repository has open issues about that . Iām not sure wether this is a regression or if it was even fixed at some point.
Iāve got a problem creating a release using Docker, maybe someone can help?
Iām using the Dockerfile from https://hexdocs.pm/phoenix/releases.html#containers
Everything seems fine until it fails short time before finish with following message:
Step 23/26 : COPY --from=build --chown=nobody:nobody /app/_build/prod/rel/my_app ./
COPY failed: stat /var/lib/docker/overlay2/eb170e088a8c087d23f677f13e3f832062014759af8564efe30c4292656da00a/merged/app/_build/prod/rel/my_app: no such file or directory
You probably need to change the name of the file to match the name of your release in that line.
Oh man, thx
Of course, how could Iāve been so blind, that happens when doing things late at night
Working now
/edit:
Works fine on Linux, however on Windows I run into the same issue as others here:
Step 14/26 : RUN npm run --prefix ./assets deploy
---> Running in 866f8ef90270
> @ deploy /app/assets
> webpack --mode production
/app/assets/node_modules/.bin/webpack: line 1: XSym: not found
/app/assets/node_modules/.bin/webpack: line 2: 0025: not found
/app/assets/node_modules/.bin/webpack: line 3: 04ec15c01fc3c268b6405aedcd29653e: not found
/app/assets/node_modules/.bin/webpack: line 4: ../webpack/bin/webpack.js: not found
npm run --prefix assets
does not work on Windows. If you do something like cd assets && npm run deploy
then it should be good to go.
Thanks for the reply. Iāve tried this already as Iāve seen this suggestion somewhere else, but it does not seem to work for me, the result is the same.
However, itās not critical for me as Iām working mainly with Linux, itās just a bit sad
Thanks for all your work
The main problem I see is this being released in the default generators for Phoenix 1.5; despite signaling otherwise. Right now, following the README to setup a brand new project on Windows just fails and could lead someone in a trail to Stack Overflow questions and undocumented NPM behaviors (Also, as I said before, thereās no track of this issue in the new NPM repository).
Could someone say something about the reasoning behind that? Motivations, what changed, etc?
Also, is there anything that can be done to ease the experience with Phoenix 1.5 for Windows users?