-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Fix handling of absolute config files in upgrade tool #15927
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Such a simple fix, love it!
Problem still persist.
|
Same problem here:
|
@kudziajaroslaw98 @msoler75 hey! Sorry for the confusion but we only release v4.0.1 right now. Mind updating and trying again? |
It's not quite out yet — waiting for the build to finish and npm to publish it. Should be like… 10–15m from now. |
It's out now 👍 |
i got the same issue, any fix? :( |
I don't know if it's me but it's not working still.
|
Same problem here
|
@marcopedone @kudziajaroslaw98 This seems to be a different error, mind creating a new issue with a repro so we can take a look? |
Issues is not resolved but pull request it closed 😂 |
Closes #15220
This PR fixes an issue where the upgrade tool would not be able to load some JavaScript config files across different drive letters on Windows.
The issue in detail is that
path.relative(…)
tries to build a relative path but if the file is inside the same folder, it won't start the relative path with a./
so we manually appended it in case that it isn't there. The issue on Windows specifically is thatfile.relative(…)
can also return a legit absolute path, e.g. when the file is on a different drive. In this case we obviously don't want to prefix a path with./
.Test plan
To reproduce this issue, I checked out a Tailwind v3 project on a different drive letter than my Windows installation. In that case, I was adding a repo inside
D:
whilenpm
was installed inC:
. I then runnpx @tailwindcss/upgrade
to reproduce the issue.The fix was validated with a local
bun
run of the upgrade tool: