jaspr icon indicating copy to clipboard operation
jaspr copied to clipboard

Tailwind css config issue (The system cannot find the file specified.)

Open shiwam77 opened this issue 1 year ago • 2 comments

After installing tailwind css with this command

curl -sLO https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-

Command tailwindcss -h its working Output: C:\Users\ayusha>tailwindcss -h

tailwindcss v3.4.10

Usage: tailwindcss [--input input.css] [--output output.css] [--watch] [options...] tailwindcss init [--full] [--postcss] [options...]

index.html

<html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="scaffolded-by" content="https://github.com/schultek/jaspr">

        <title>student_management_system</title>
        <link rel="stylesheet" href="styles.css"/>
        <!--
            Loads and runs the compiled 'main.dart' file,
            can be changed to any other .dart file inside /web.
        -->
        <script defer src="main.dart.js"></script>
    </head>
    <body>
        <!-- Your app component will be inserted here. -->
    </body>
</html>

File architecture: web < styles.tw.css

@tailwind base;
@tailwind components;
@tailwind utilities;

Where i am doing wrong here ??

This is my pubspec.yaml

description: A new jaspr project.
version: 0.0.1

environment:
  sdk: '>=3.0.0 <4.0.0'

dependencies:
  flutter:
     sdk: flutter
  jaspr: ^0.15.0
  jaspr_flutter_embed: ^0.3.4
  jaspr_router: ^0.5.1

dev_dependencies:
  build_runner: ^2.4.0
  jaspr_web_compilers: ^4.0.10
  jaspr_builder: ^0.15.0
  flutter_test:
    sdk: flutter
  flutter_lints: ^3.0.0
  jaspr_tailwind: ^0.3.0

jaspr:
  mode: client

flutter:
  uses-material-design: true

Error

[BUILDER] [ERROR] ProcessException: The system cannot find the file specified.
[BUILDER] [ERROR]
[BUILDER] [ERROR] Command: tailwindcss --input C:\Users\ayusha\AppData\Local\Temp\scratch_space6a2d55f2\web\styles.tw.css --output C:/Users/ayusha/AppData/s[BUILDER] [ERROR] Failed after 2m 47s
[CLI] [ERROR] Failed building web assets. There is probably more output above.
[BUILDER] [ERROR] ProcessException: The system cannot find the file specified.
[BUILDER] [ERROR] 
[BUILDER] [ERROR] Command: tailwindcss --input C:\Users\ayusha\AppData\Local\Temp\scratch_space6a2d55f2\web\styles.tw.css --output C:/Users/ayusha/AppData/Local/Temp/scratch_space6a2d55f2/web/styles.css --confs
[BUILDER] [ERROR] Failed after 2.4s
[CLI] [ERROR] Failed building web assets. There is probably more output above.

shiwam77 avatar Sep 10 '24 05:09 shiwam77

Hey @schultek I will add my voice to this issue as I have been having the exact same issue. Everything is installed as specified in the docs but have an issue similar to the original author.

I have just resorted to using the tailwind cdn link directly as an alternative to bypass this.

Also mentioned it in a different issue before seen here.

Do wonder if there are gotchas or something we aren't doing right to get this working properly.

Thanks.

TJMusiitwa avatar Sep 13 '24 00:09 TJMusiitwa

Hey @schultek I have figured out that while using server-side rendering, both Tailwind and the @Css annotation are working, but in client-side rendering, neither the CSS annotation is working nor Tailwind is correctly configured.

shiwam77 avatar Sep 15 '24 05:09 shiwam77

Hi @schultek, I guess I know what the issue is. It is just that dart doesn't detect environment variables sometimes, I don't know the exact issue, but I know how to fix it.

If the parameter runInShell is set to true in jaspr_tailwind at line 55, it seems to work on my pc.

Let me know if this was the issue and if I can open a PR with this change?

ShivanshuKGupta avatar Dec 10 '24 10:12 ShivanshuKGupta

Can also confirm that forking jaspr_tailwind and setting runInShell: true solves this issue for me.

defuncart avatar Dec 19 '24 14:12 defuncart

@ShivanshuKGupta Thanks for investigating, a PR would be much appreciated.

schultek avatar Dec 20 '24 10:12 schultek

Merged and fixed in jaspr_tailwind v0.3.1

schultek avatar Dec 27 '24 17:12 schultek