Skip to content

Don't read CSS file when it was deleted #765

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

Merged
merged 1 commit into from
Apr 24, 2023

Conversation

mskelton
Copy link
Contributor

In Neovim when using the Tailwind language server, deleting a CSS file results in the following error:

[ERROR][2023-04-21 21:06:00] ...lsp/handlers.lua:535    "Unhandled exception: ENOENT: no such file or directory, open '/my/file/path/hi.css'\nError: ENOENT: no such file or directory, open '/my/file/path/hi.css'"

This is happening due to the LSP attempting to read from the now deleted CSS file during file watch changes. I updated the code that was reading from the CSS files to first ensure that it wasn't a Deleted change event.

@mskelton mskelton force-pushed the fix-watch-file-error branch from d256fa9 to acbadb7 Compare April 22, 2023 02:13
@mskelton mskelton changed the title Safely read CSS file to prevent error when deleting Don't read CSS file when it was deleted Apr 22, 2023
@mskelton mskelton marked this pull request as ready for review April 22, 2023 02:13
@bradlc
Copy link
Contributor

bradlc commented Apr 24, 2023

Nice catch, thank you!

@bradlc bradlc merged commit c5d20ab into tailwindlabs:master Apr 24, 2023
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

Successfully merging this pull request may close these issues.

2 participants