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.