Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot deploy on Fly.io #71

Open
MicrexIT opened this issue Oct 29, 2024 · 7 comments
Open

Cannot deploy on Fly.io #71

MicrexIT opened this issue Oct 29, 2024 · 7 comments

Comments

@MicrexIT
Copy link

MicrexIT commented Oct 29, 2024

Hello,
I tried saladui today and it is really great. However, I am having troubles deploying it on Fly.io.
I am using the latest version 0.11.0 adding each component manually.
I am having problems with Tails. Not sure what I am doing wrong but I didn't find anything in the documentation. Here is the log:

#24 6.120 error: module Tails is not loaded and could not be found. This may be happening because the module you are trying to load directly or indirectly depends on the current module

#24 6.120 │

#24 6.120 3 │ use AppWeb.Component

#24 6.120 │ ^^^^^^^^^^^^^^^^^^^^^^^

#24 6.120 │

#24 6.120 └─ lib/app_web/components/tooltip.ex:3: AppWeb.Component.Tooltip (module)

#24 6.120

@bluzky
Copy link
Owner

bluzky commented Oct 30, 2024

@MicrexIT do you this dependency {:tails, "~> 0.1.5"}, in your mix.exs.

@MicrexIT
Copy link
Author

MicrexIT commented Oct 30, 2024

@bluzky When I add tails in my mix.exs I get the following error

5.745 == Compilation error in file lib/tails.ex ==
5.745 ** (File.Error) could not read file "/app/assets/tailwind.colors.json": no such file or directory
5.745     (elixir 1.17.2) lib/file.ex:385: File.read!/1
5.745     lib/tails.ex:3: (module)

But I do have tailwind.colors.json in my assets directory (it's been generated by the mix salad init command)
Fyi, locally everything works fine

@MicrexIT
Copy link
Author

I managed to deploy by removing this line from my config (generated with mix salad.init)

config :tails, colors_file: Path.join(File.cwd!(), "assets/tailwind.colors.json")

@bluzky
Copy link
Owner

bluzky commented Oct 30, 2024

I managed to deploy by removing this line from my config (generated with mix salad.init)

config :tails, colors_file: Path.join(File.cwd!(), "assets/tailwind.colors.json")

If you remove this config, tails will not work correctly.
Could you share your docker file?

Or you can check my Dockerfile for storybook here https://github.com/bluzky/salad_storybook/blob/main/Dockerfile

@tschmidleithner
Copy link

@MicrexIT I had the same problem.
You can fix that by moving COPY assets assets before RUN mix deps.compile in your Dockerfile since the JSON file is required to build tails.
As pointed out by @bluzky, see also the Dockerfile for the SaladUI storybook.

@ashkan117
Copy link
Contributor

@MicrexIT I ran into the same problem in the beginning. Can you take a look at this issue and see if it solves your problem. If it helps I can create a small pr to add to the README for deploying

@pierrelegall
Copy link
Contributor

Does v0.14.0 fixed this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants