Skip to content

Conversation

@thecrypticace
Copy link
Contributor

@thecrypticace thecrypticace commented Jan 27, 2025

Fixes #1149

This PR does a few things:

  • Fixes an error loading the Yarn PnP API on Windows
  • Fixes a case-sensitivity issue on Windows when using Yarn PnP. Yarn's PnP lookups are case-sensitive down to the drive-letter. The VSCode extension host generally operates with lowercase drive letters but filesystem calls don't return that breaking Yarn's resolution.
  • Fixes an issue loading Tailwind CSS when Yarn PnP is enabled. We now have to use require(…) because that's what's hooked at runtime. It does not work with await import(…) unfortunately. I plan to investigate this more to see if I can change this back in the future. We really should not ever load the CJS version of v4.

There are most certainly some other problems using Yarn PnP with older Tailwind CSS versions and IntelliSense right now but I plan to address these in a followup PR later.

Here's the output panel from a project loaded through Yarn PnP on Windows:
Screenshot 2025-01-29 at 11 33 56

@thecrypticace thecrypticace marked this pull request as draft January 27, 2025 14:04
Base automatically changed from fix/v4-text-theme-suggestions to main January 28, 2025 15:14
@thecrypticace thecrypticace force-pushed the fix/yarn-pnp-resolver-windows branch 3 times, most recently from b9ee81d to a252016 Compare January 29, 2025 16:25
@thecrypticace thecrypticace marked this pull request as ready for review January 29, 2025 16:25
@thecrypticace thecrypticace changed the title Fix loading of the Yarn PnP API on Windows Fix loading of the Yarn PnP API Jan 29, 2025
A call to `setup()` is required for resolution to function at all
It does not intercept calls to `await import()`. Manually registering the ESM hook also results in failed fs.stat calls.
@thecrypticace thecrypticace merged commit 1ea192e into main Jan 29, 2025
@thecrypticace thecrypticace deleted the fix/yarn-pnp-resolver-windows branch January 29, 2025 16:52
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.

Unable to load project when using Yarn PnP on Windows in 0.14.*

3 participants