Hello! I was updating a project of mine to Rescript 11 and got this error:
[@jihchi/vite-plugin-rescript] rescript: [198/217] src/Core__List.cmj
FAILED: src/Core__List.cmj
We've found a bug for you!
/Users/matheus.ashton/dev/pessoal/pet-manager/node_modules/@rescript/core/src/Core__List.res:582:39
[@jihchi/vite-plugin-rescript]
580 │ reduceReverseUnsafe(l, acc, f)
581 │ } else {
582 │ A.reduceReverseU(toArray(l), acc, f)
583 │ }
584 │ }
This function is a curried function where an uncurried function is expected
Is weird because it’s complaining about the core package itself.
I’m using the following versions:
Rescript - 11.0.1 @rescript/react - 0.12.1 @rescript/core - 1.1.0
But I’m not sure what do I have to do to be compliant with that breaking change, because versions above 1.0 should be compatible with Rescript 11 right? Should I downgrade it?
Or, even it shows the List module in the stack trace, the problem is actually in my code, on how I’m using the List module, and the fix should update those calls?
Well, can you create a minimal repro? I just created a dummy project with ReScript 11.0.1 and Core 1.1.0 and tried using List.reduceReverse but everything works fine. Both in curried and uncurried mode.
This situation isn’t great obviously. v12 will have Core inside of the compiler itself so the problem will go away, but we should do what we can to clear up the situation before too. Suggestions welcome.
@jihchi oh sorry, I misunderstood, I thought that the repo you posted was exactly the minimal example. The main point is, with a fresh installation, I can’t reproduce the issue, so it’s something related to my code or one of the libraries I’m using, what makes difficult to create something “minimal”
Based on this post I tried to figure out if some other library was using some old version of rescript core, but it doesn’t be the case:
⋯/rsus on main [✘!?] via v18.20.2 took 836ms
❯ npm ls --all | grep "rescript/core"
├─┬ @rescript/[email protected]
│ ├─┬ @rescript/[email protected]
@rescript/[email protected]
node_modules/@rescript/core
@rescript/core@"^1.3.0" from the root project
@rescript/[email protected]
../rescript-auth0-react/node_modules/@rescript/core
@rescript/core@"1.3.0" from [email protected]
../rescript-auth0-react
[email protected]
node_modules/rescript-auth0-react
rescript-auth0-react@"^1.0.0" from the root project