liamkillingback

liamkillingback

Error: Cannot find module 'tailwindcss/plugin'

Error: Cannot find module ‘tailwindcss/plugin’

I’ve just come across this new error whilst launching/deploying to fly.
When the deploy gets to the mix assets.deploy step, i get this error:

 => CACHED [builder 12/19] COPY assets assets                                                                                                    0.0s
 => ERROR [builder 13/19] RUN mix assets.deploy                                                                                                  4.0s
------
 > [builder 13/19] RUN mix assets.deploy:
0.936 
0.936 06:16:42.689 [debug] Downloading tailwind from https://github.com/tailwindlabs/tailwindcss/releases/download/v3.3.2/tailwindcss-linux-x64
3.901 
3.901 Rebuilding...
3.961 Error: Cannot find module 'tailwindcss/plugin'
3.961 Require stack:
3.961 - /app/assets/tailwind.config.js
3.961     at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
3.961     at Function._resolveFilename (pkg/prelude/bootstrap.js:1955:46)
3.961     at Function.resolve (node:internal/modules/cjs/helpers:108:19)
3.961     at _resolve (/snapshot/tailwindcss/node_modules/jiti/dist/jiti.js:1:241025)
3.961     at jiti (/snapshot/tailwindcss/node_modules/jiti/dist/jiti.js:1:243309)
3.961     at /app/assets/tailwind.config.js:4:16
3.961     at jiti (/snapshot/tailwindcss/node_modules/jiti/dist/jiti.js:1:245784)
3.961     at /snapshot/tailwindcss/lib/lib/load-config.js:37:30
3.961     at loadConfig (/snapshot/tailwindcss/lib/lib/load-config.js:39:6)
3.961     at Object.loadConfig (/snapshot/tailwindcss/lib/cli/build/plugin.js:135:49) {
3.961   code: 'MODULE_NOT_FOUND',
3.961   requireStack: [ '/app/assets/tailwind.config.js' ]
3.961 }
3.985 ** (Mix) `mix tailwind default --minify` exited with 1
------
Error: failed to fetch an image or build from source: error building: failed to solve: process "/bin/sh -c mix assets.deploy" did not complete successfully: exit code: 1

I think I came across this a while ago but can’t remember how i resolved it..

Any help would be appreciated

Cheers :slight_smile:

Most Liked

Anxiko

Anxiko

I had this same issue and solved it by installing node in my Dockerfile for the builder step, and installing the packages right before the call to RUN mix assets.deploy:
RUN npm install --prefix assets/

It took me a while to figure this out since while I was getting the same error message of Error: Cannot find module 'tailwindcss/plugin', the package that I was actually missing was flowbite (that’s on me, I had added this package but had forgotten about it).

Where Next?

Popular in Questions Top

stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
jason.o
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

Other popular topics Top

sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 40042 209
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
senggen
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

We're in Beta

About us Mission Statement