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

no such file or directory, open '[...]/dist/css/preflight.css' #4

Closed
markokajzer opened this issue Oct 23, 2023 · 4 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@markokajzer
Copy link

markokajzer commented Oct 23, 2023

Hey! I would love to use your extension, since https://github.com/heybourn/headwind is completely unmaintained, but I'm encountering the following issue 😭

Let me know if you need anything else!

Describe the bug

When running the sort command (either through the command panel or by saving the file) I get the following error (also see screenshot)

A system error occurred (ENOENT: no such file or directory, open '/Users/amaterasu/.vscode/extensions/trapfether.tailwind-raw-reorder-3.0.3/dist/css/preflight.css')

To Reproduce

Steps to reproduce the behavior:

  1. Install extension
  2. Create basic html file, e.g. <div class="py-3 block"></div>
  3. Save or run command
  4. See error

Expected behavior
Tailwind classes are sorted

Screenshots
Screenshot 2023-10-23 at 08 42 29

Desktop (please complete the following information):

  • OS: macOS Ventura 13.5.2
  • Extension version: v3.0.3
@kg-currenxie
Copy link

Same here

@intrepidws
Copy link

Samesies

@Trapfether Trapfether self-assigned this Nov 27, 2023
@Trapfether Trapfether added the bug Something isn't working label Nov 27, 2023
@Trapfether
Copy link
Owner

I'm looking into this. It appears that the issue described occurs when no local tailwind config can be found for the file. The extension is meant to use the default tailwind config in this case, but that is not happening as expected. I anticipate I'll have this figured out this week.

If anyone else is encountering this issue that HAS a local tailwind config for the impacted file, please expand on you situation here.

As a temporary work-around for those impacted, you can put a basic tailwind.config.js file at the base directory of your project.

@Trapfether
Copy link
Owner

Here is the update. The extension was updated to version 3.1.0 today. This fixes the preflight not found exception.

However, The extension requires a local tailwind.config file to function correctly and will show the user an error if none is found. This is so that the extension won't touch workspaces that are not using tailwind at all. I cannot imagine the frustration that would occur if a non-tailwind project suddenly had classes moving around because they accidently overlap with tailwind classes.

This means that in the future if we add options for ordering custom / unknown classes (the current behavior is that custom classes are left in their current order) we won't accidently stomp all over someone's non-tailwind project because they flipped that switch globally.

You can use a dummy config file and include it in your .gitignore if you're just looking for local functioning and don't want to include the tailwind config in your repo for some reason.

I will leave this issue open for a few days in case people want to respond to how I went about this. If you have any feedback, I'd be glad to hear it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants