What would the repo with the repro be useful for? to reproduce the error message and improve it? The solution is an unfortunate interaction between rescript/rewatch and bun 1.3.x, so I don’t think there is anything rescript itself can improve besides the error message.
Cool repo though, I’m learning a few things already.
For example today I had some issues because Bun only recognices certain extensions and when you use the recommended suffix of .res.js then any *.test.res.js or *_test.res.js don’t get recognized when you run bun test. source
There are two workarounds I considered, one, is to change the suffix of the compiled files from .res.js to .js, but that makes me scared of running rescript clean and all my .js files I have in the project getting nuked. Maybe it is not an issue?
The other workaround I went with for now is to make a package.json script that does:
"test": "bun test ./packages/*/src/**/*_test.res.js",
"test:watch": "bun test --watch ./packages/*/src/**/*_test.res.js"
Which uses shell expansion with relative paths (the ./ at the start was necessary) and then bun does run the test files even if they don’t match the paths it wants. But I guess this won’t detect new test files when added, sadly.
I see in your repo you are running with "suffix": ".js", source, are there any gotchas to that?