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.
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)
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?
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"