Cache Race between Rescript and Webpack?

Hi Folks
Maybe not directly a rescript problem but wondering if anyone else is having problems with bs.js file changes not being picked up by webpack? It seems that the first file that changes (or some number up to the watch timeouts in webpack config?) trigger a build, and then files changed after get missed. Just a theory though. The end result is that file changes start getting lost and I have to manually touch the bs.js file to get it compiling again… (A few of those at the same time can get fun too)


Maybe not your case but we found that files with warnings are not reloaded because of some missing timestamp (I’m on windows).

I noticed similar issues with React Native (so metro bundler instead of webpack). I have to save twice to get a reload sometimes.

To ensure files with warnings are always rebuilt. We added some special flags to the timestamp of files with warnings, that may be the cause of your issue

Two independent issues here:

  • Files with warnings not rebuilt.
  • Bundler like webpack and metro having races.

First one might be what Bob said. Second one is likely inevitable from webpack/metro’s watchers. File system is inherently race-y sadly (good knowledge here and here).