-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Make this work with yarn berry (aka yarn 2/3/4) #26
Comments
Can you check the issues, it's been discussed. It's impossible. Or: feel free to spend like a month on this if you really want it. Also: I think svelte itself also is like: yeah, no, not going to happen. |
I have made it work with the above code, so it's not impossible. It you can change the resolver to add those few lines of code to detect pnp, then it will work fine. I'm happy to help here. Old comments about yarn pnp not working with svelte are no longer true, as bugs have been fixed. |
This pkg is a ton of code, it’s a copy of the actual node internals. Just using require isn’t going to work on ESM files for this project. If that’s all your use case, then that’s fine for you? I meant Rich’s comments on not being interested in supporting PnP |
Please see #23 (comment) and the above and related threads, which include the yarn maintainer |
This package will only be loaded in the PnP case, so it won't penalize anyone else. I have not investigated how to do the fix with the ESM portions of your code, as I don't require that, but I'm sure something similar can be done in your code to handle this. If necessary we can get help from the yarn folks like @arcanis who have been very active in helping with exactly these situation. I'm willing to help too. As I said before, I have resolved my problem by patching Prettier and bypassing the call to this package, but I'm trying to advocate for a broader fix which will help more people.
Yes, I have seen this. I find it not very useful or helpful. Svelte does not need to do anything directly to support PnP, the issues are with underlying packages (like this one). His comment is also quite old. yarn pnp is very actively developed and constantly improving. |
Ok well #23 (comment) still stands. I think it’s going to take several weeks for someone to implement. It would be a fork of this project or a completely different project. If someone wants to make that, we can talk again after that. |
See PR #28 |
Currently prettier, which uses import-meta-resolve does not work with yarn berry using PnP (the default node linker): yarnpkg/berry#6167.
This effectively breaks sveltkit when used with yarn berry.
I have been able to fix the problem in prettier by changing the importFromFile function as follows:
However, the real fix should be implemented in import-meta-resolve rather than prettier (the fix can be essentially the same).
You can easily reproduce the issue using the steps in the above yarn issue.
I'm happy to help with making the fix if it's something you will accept. Currently I have to patch it in prettier since import-meta-resolve is embedded in there distribution.
The text was updated successfully, but these errors were encountered: