[ANN] ReScript 12 beta release / call for testing

Yeah this is a major pain. The reason for this being the way it is is that the compiler is not designed to continue when it encounters a type error. This is because it wouldn’t be able to type check after the type error in a “honest” way.

Good news is we’ve actually prototyped a way of making this work, by having a mode in the compiler that the editor can use, where we tell the type checker to pretend that the type error didn’t happen, and pretend it type checked successfully. This solves this issue for the editor, while letting the regular compile mode work as it does now (strict).

I fully agree this is terrible and that it’d be a huge QoL improvement to fix this. With a little luck it’s something we’ll be able to land before v12 ships, and if not we can hopefully land it close after.

5 Likes

although i agree it would be a nice qol improvement, i never found it to be a major pain. only seeing the next error is fine, because you fix it, and then you immediately see the next anyway. go to definition and syntax highlighting always worked for me beyond errors (doom emacs)

2 Likes

I’m getting this error after updating from the alpha and the legacy compiler to beta.4 and rewatch.


  The module or file Pervasives can't be found.
  - If it's a third-party dependency:
    - Did you add it to the "dependencies" or "dev-dependencies" in rescript.json?
  - Did you include the file's directory to the "sources" in rescript.json?

There currently is no clean happening when you upgrade to a newer version.
If you haven’t tried that yet, you could give that a shot.

I’ve run clean. The issue is also happening on CI Rescript beta 4 · jderochervlk/plex-movie-night@3bef778 · GitHub

i recall there being some top-level functions that implied Pervasives, maybe you’re using one of them?

maybe have a look through here:

I’m still getting this. I’ve tried cleaning and I’ve been removing dependencies hoping that would resolve the issue. I’ve even tried adding the Pervasives.res file to my project directly and I still get the same error.

I did manage to maybe find out some more information by running it using rescript legacy build.

>>>> Start compiling
Dependency on @rescript/webapi
rescript: [1/315] WebAPI.cmi
FAILED: WebAPI.cmi

  We've found a bug for you!
  command line

  The module or file Pervasives can't be found.
  - If it's a third-party dependency:
    - Did you add it to the "dependencies" or "dev-dependencies" in rescript.json?
  - Did you include the file's directory to the "sources" in rescript.json?
  

FAILED: cannot make progress due to previous errors.
Failure: /home/josh2/Dev/plex-movie-night/node_modules/.deno/@rescript+linux-x64@12.0.0-beta.4/node_modules/@rescript/linux-x64/bin/ninja.exe 
Location: /home/josh2/Dev/plex-movie-night/node_modules/@rescript/webapi/lib/bs

This gives me more information than the errors I am getting when using Rewatch, which is the same error repeated 10 times without a source for the error.

 We've found a bug for you!
  command line

  The module or file Pervasives can't be found.
  - If it's a third-party dependency:
    - Did you add it to the "dependencies" or "dev-dependencies" in rescript.json?
  - Did you include the file's directory to the "sources" in rescript.json?```

Looking at @rescript/webapi version 0.1.0-experimental-fe47fc9 I can see that it’s using v12 beta.3. I tried using beta.3 in my app and I still get the same error using legacy and rewatch.

I tried removing that from my deps to see what would happen. Still no success. Now the error is showing up for my own files. Here’s a small file that has this error.

type t<'a> = {mutable value: 'a}

@module("@preact/signals")
external signal: 'a => t<'a> = "signal"

@module("@preact/signals")
external computed: unit => t<'a> = "computer"

@module("@preact/signals")
external effect: unit => unit = "effect"

@module("@preact/signals")
external batch: unit => unit = "batch"

@module("@preact/signals")
external useSignal: 'a => t<'a> = "useSignal"

@module("@preact/signals")
external useComputed: unit => t<'a> = "useComputed"

@module("@preact/signals")
external useSignalEffect: unit => unit = "useSignalEffect"

This is definitely caused by using Deno, similar to this error for pnpm: 12.0.0-alpha.13: Pervasives not found when using pnpm · Issue #7526 · rescript-lang/rescript · GitHub

If I switch over to npm and install the error goes away.

interesting re. pnpm vs npm. maybe you can git add node_modules and do a diff with pnpm / npm?

i’ve deployed beta 4 since it was released and have it running in production non-stop, working fine (had to do migrations for the *ToEnd functions).

what’s missing for a final release?

1 Like

This is the v12 milestone, there are still some bugs: GitHub · Where software is built
Also lot’s of documentation to be done.

That’s not to say every single issue there has to be resolved, but the bugs at least.

4 Likes

We’re still fixing some remaining bugs and I think we’d also like to deploy a migration tool before releasing v12.

2 Likes