-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
The --loader
flag is ignored
#174
Comments
@JounQin fixing this would solve the following issues: the community would be really greatful ❤️ |
Sorry I'm not familiar with these concepts and don't quite have enough time recently :( If anyone can raise a PR that would be really appreciate. |
@arcanis i tried to follow your suggestion and created a draft PR here https://github.com/un-ts/synckit/pull/175/files, but the prettier plugin still seems to fail in latest vscode with yarn pnp. Did I misunderstand something? |
Did you lint on typescript files? To my understanding what's been ignored is here: Lines 211 to 213 in 22387b4
|
@hanyufoodles see yarnpkg/berry#6335 (comment) pls, from my understanding this https://github.com/prettier/eslint-plugin-prettier/blob/de9751c85d059678904035322501bfce120f61b7/worker.js#L36 import fails because of lack of pnp loader in the context of a worker. |
With latest vscode (1.90.2) and |
FWIW, your PR is working for me. Latest vscode and eslint-plugin-prettier. I cloned your forked repo, and linked synckit and voila! Eslint is working again. I'm also using latest yarn and latest yarn sdks for eslint. |
@imccausl interesting! and you're also using pnp mode i suppose? I actually used pretty naive approach of directly editing the unplugged package code to verify if this works. I'll retest that tomorrow by building the code from PR and "linking" to a local synckit package. Thanks for the hint <3 |
Yep. pnp mode 💯. I was also poking around at this issue and ended up basically with the same solution as you, so I was surprised to see it wasn't working for you. |
I can also confirm it fixes the issues we had at work with ESLint in VSCode when using Note that you probably have to update both the |
@arcanis thanks a lot for the update! not updating both cjs and esm files in the unplugged package was exactly the reason it didn't work for me! Setting
with both files compiled makes it work for me too! |
@JounQin thanks a lot ❤️ |
When using PnP, SyncKit automatically adds the
--loader
flag. Unfortunately, this doesn't work in Node.js, the--loader
flag is accidentally ignored for workers.Instead, I suggest you try calling
module.register
from within the worker thread itself, as an implementation detail of therunAsWorker
function.The text was updated successfully, but these errors were encountered: