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

Support for Yarn PnP #358

Open
5 tasks done
bmulholland opened this issue May 2, 2024 · 5 comments
Open
5 tasks done

Support for Yarn PnP #358

bmulholland opened this issue May 2, 2024 · 5 comments

Comments

@bmulholland
Copy link

Describe the bug

When using Yarn PnP (and possibly with pnpm without some forms of hoisting?), there's no node_modules directory. In this case, the icons from an iconify pack aren't imported. With the vite example from the examples dir, with default yarn settings, I get "Internal server error: Icon mdi/alarm-off not found"

This may be an issue with a dependency (iconify?). It may also be expected behaviour -- in which case, maybe there's a less "magic" way to configure the imported icons. If so, could just document that.

I'm happy to dig into this myself, if I can get some pointers of where to look. Right now I'm not even sure if this is the right project to report this too -- a lot of magic is going on!

Reproduction

Repro'd with example from examples dir. Just take files, add yarn berry with default settings, and try yarn dev

System Info

yarn 4.1.1, latest macOS

Used Package Manager

yarn

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
@antfu
Copy link
Member

antfu commented May 2, 2024

I don't have interests in supporting PnP, nor taking the complexity. Maybe we could expose an array where you can tell explicitly what collections are available?

@bmulholland
Copy link
Author

bmulholland commented May 3, 2024

Yeah I was thinking of something like that. It feels like there's likely just a bit of explicit configuration that could side-step the whole problem. That would be both acceptable (to the end-user dev) and way easier to maintain (for you). I'd be happy to poke at doing something like this -- sounds like you already have an idea of what/where? Could you point me in the right direction of where that array would go?

@bmulholland
Copy link
Author

Just to drop in my initial thought: use the customCollections code to provide an explicit mapping. I don't know if that could work?

@antfu
Copy link
Member

antfu commented May 3, 2024

Sure, feel free to send a PR and we could discuss with the implementation

@bmulholland
Copy link
Author

I guess I buried my question. I don't know where to start with the PR :). Could you kindly point me to where the magic resolution of collections happens? Any place I could start? Context that could help me? Even a file name or a sentence or two of context?

Like I say, I don't even know if the right code is in this repository. I don't have time to wrap my head around the multiple repos involved, but can certainly start something if I know the right place to look...

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

No branches or pull requests

2 participants