How to get tailwindcss-animate to deploy with app?
Closed this issue · 4 comments
bluejack commented
Building the docker image for deployment seems to not want to include this dependency. I can't figure out what I am missing. Does anyone have a working reference build so I can figure out what I am missing? Everything else seems to go fine.
bluejack commented
It's a very particular sequencing of docker commands, different from default.
MicrexIT commented
It's not working for me, how did you manage ? On Fly.io I the deployment always fails with:
#23 3.390 Error: Cannot find module 'tailwindcss-animate'
#23 3.390 Require stack:
#23 3.390 - /app/assets/tailwind.config.js
#23 3.390 at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
#23 3.390 at Function._resolveFilename (pkg/prelude/bootstrap.js:1955:46)
#23 3.390 at Function.resolve (node:internal/modules/cjs/helpers:108:19)
#23 3.390 at Function.resolve (/snapshot/tailwindcss/standalone-cli/patch-require.js:34:38)
#23 3.390 at _resolve (/snapshot/tailwindcss/node_modules/jiti/dist/jiti.js:1:251148)
#23 3.390 at jiti (/snapshot/tailwindcss/node_modules/jiti/dist/jiti.js:1:253746)
#23 3.390 at /app/assets/tailwind.config.js:24:5
#23 3.390 at evalModule (/snapshot/tailwindcss/node_modules/jiti/dist/jiti.js:1:256443)
#23 3.390 at jiti (/snapshot/tailwindcss/node_modules/jiti/dist/jiti.js:1:254371)
#23 3.390 at /snapshot/tailwindcss/lib/lib/load-config.js:52:30 {
#23 3.390 code: 'MODULE_NOT_FOUND',
#23 3.390 requireStack: [ '/app/assets/tailwind.config.js' ]
#23 3.390 }
#23 3.409 ** (Mix) `mix tailwind scribu --minify` exited with 1
#23 ERROR: process "/bin/sh -c mix assets.deploy" did not complete successfully: exit code: 1
------
bluejack commented
I can't promise this is the best answer, but here's the section of my dockerfile that i had to re-order several which ways to get a functioning docker image:
COPY config/config.exs config/${MIX_ENV}.exs config/
COPY assets assets
RUN mix deps.compile
COPY priv priv
COPY lib lib
RUN npm install --prefix ./assets
# compile assets
RUN mix assets.deploy
# Compile the release
RUN mix compile
# Changes to config/runtime.exs don't require recompiling the code
COPY config/runtime.exs config/
COPY rel rel
RUN mix release
bluejack commented
Curious to know if that worked for you!