-
Notifications
You must be signed in to change notification settings - Fork 19
Error on Custom Plugin #32
Comments
Does @jdalton Could you please take a look? I believe it's related to ESM loader, most likely when it's wired together with Babel. Happens for me from time to time as well, especially when I upgrade the loader, but I never had a chance to have it reproducible and narrowed down. Wiping loader cache always helps. |
@deepsweet wow, just deleted it and it works like magic 👍 |
@luii yes, please make a PR, I'll do the rest of minor tweaking 👍 thanks! |
I would love to! |
From the run without the plugin to the next run with the plugin was there any other error? @luii Can you reproduce this error consistently? For example run it without the plugin. Next add the plugin and run it again (does it error?). If it does could you create a small repro repo with the repro case? |
@jdalton No unfortunatly not. I didnt changed anything, also cloned it fresh and retried the steps i've made. If it happens again i let you know as soon as possible! |
@deepsweet The cache miss on In cases of an upgrade I can detect that a previous Update: I guess I could detect the version change on-startup before Babel runs and just delete their cache without 2 passes. |
@jdalton no other caches are involved, the only custom thing passed to I have just reproduced a similar issue: rm -rf node_modules/
yarn
yarn start packs plugin-sequence plugin-lib-babel
yarn start packs plugin-sequence plugin-lib-babel
yarn start packs plugin-sequence plugin-lib-babel
yarn test
I have an idea: because the issue comes up so randomly it must be related to some race. And I have a lot of racing things here: I think the commands above are still not 100% reproducible, but my idea is to run things in parallel many times to catch that race condition. If I'm right maybe it can be solved by using an approach similar to graceful-fs for writing cache (busy files, retries, etc)? |
|
@jdalton I'm not 100% sure again, but as I recall the upgrade issue doesn't come up every time... if it's detectable from the loader side and you can clean up the cache manually then in my opinion it's totally fine to do so. There is no |
Ah, it's related to Istanbul which I'm using totally manually.
|
I think it's in the stack trace because this time it fails on "coverage" plugin (randomly?). The first thing is the same, From time to time I can catch it even without running tests, but after some parallel races for sure. |
Cool! Okay, I have a couple things to try out. Update: @deepsweet Where are you caching instanbul's output? |
@jdalton I don't think Istanbul has its own cache, but it uses inline Source Maps which comes from Babel.
|
At the same time Istanbul itself is using Babel internally to traverse AST and instrument code. |
I have some logic to handle invalidating |
Okay, I'm clearing the babel cache for more things now and invalidating If there's continued problems with a combo of istanbul and your Update:
|
I've created a decompress plugin for start and get this error:
This is my plugin:
And this is in the
tasks/index.ts
:The text was updated successfully, but these errors were encountered: