v12.beta1 - LSP is not working. Maybe related to pnpm but I'm not sure
- Go to the branch https://github.com/DZakh/sury/tree/rescript-v12.beta
- Run
pnpm i && pnpm resfrom the root - See how in
packages/sury/src/Sury.resLSP is not working
I also tried with a legacy compiler.
And opening the packages/sury folder separately.
I assume might be caused by using pnpm.
ReScript tooling: Internal error. Something broke. Here's the error message that you can report if you want: Error: Command failed: /Users/dzakh/.cursor/extensions/chenglou92.rescript-vscode-1.62.0-universal/server/analysis_binaries/darwinarm64/rescript-editor-analysis.exe hover /Users/dzakh/code/DZakh/rescript-schema/packages/sury/src/Sury.res 3456 9 /var/folders/pv/vz3qt1p52g72mw05tb7gzgy00000gn/T/rescript_format_file_44871_21 true (this message will only be reported once every 15 minutes)
Well, I'm actually not sure of pnpm, since it worked with v11.
The lockfile got renamed, we didn't take this into account yet. It hasn't been 24 hours since the beta came out...
Still have the problem with beta.5, now with the binary file not being found.
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/dzakh/code/DZakh/rescript-schema/packages/sury/node_modules/@rescript/darwin-arm64/bin.js' imported from /Users/dzakh/.cursor/extensions/chenglou92.rescript-vscode-1.64.0-universal/server/out/cli.js
at finalizeResolution (node:internal/modules/esm/resolve:283:11)
at moduleResolve (node:internal/modules/esm/resolve:959:10)
at defaultResolve (node:internal/modules/esm/resolve:1195:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:642:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:591:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:574:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:236:38)
at ModuleLoader.import (node:internal/modules/esm/loader:539:34)
at defaultImportModuleDynamicallyForScript (node:internal/modules/esm/utils:228:31)
at importModuleDynamicallyCallback (node:internal/modules/esm/utils:250:12) {
code: 'ERR_MODULE_NOT_FOUND',
url: 'file:///Users/dzakh/code/DZakh/rescript-schema/packages/sury/node_modules/@rescript/darwin-arm64/bin.js'
}
Solved it by manually installing "@rescript/darwin-arm64": "12.0.0-beta.5", as a dev dependency, but I assume it should be working automatically.
Probably this is a ReScript repo issue 🤔
any ideas on how to fix this?
This might the same problem as in https://github.com/rescript-lang/rescript-vscode/issues/1127. I think the solution is https://github.com/rescript-lang/rescript-vscode/issues/1127#issuecomment-3291275266
In https://github.com/rescript-lang/rescript/pull/7889, I'm storing the bsc path used in compilation in a JSON file. Tooling should be able to pick this up once available.
Could you both try out latest beta (12) and latest vsix (1.65.7).
If it doesn't work, try post the result of the Dump LSP Server State command.
i'm not sure what you mean by 1.65.7. i had 1.64.0 and then did a switch to @next, which gave me 1.65.0-next-c1b3031.0.
i'm on emacs btw, not vscode. this still does not work with pnpm (but works fine with npm and also bun):
node:internal/modules/esm/resolve:275
throw new ERR_MODULE_NOT_FOUND(
^
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '<project path>/node_modules/@rescript/linux-x64/bin.js' imported from ~/.local/share/pnpm/global/5/.pnpm/@[email protected]/node_modules/@rescript/language-server/out/cli.js
at finalizeResolution (node:internal/modules/esm/resolve:275:11)
at moduleResolve (node:internal/modules/esm/resolve:860:10)
at defaultResolve (node:internal/modules/esm/resolve:984:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:685:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:634:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:617:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:273:38)
at onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:577:36)
at TracingChannel.tracePromise (node:diagnostics_channel:344:14)
at ModuleLoader.import (node:internal/modules/esm/loader:576:21) {
code: 'ERR_MODULE_NOT_FOUND',
url: 'file:///<project path>/node_modules/@rescript/linux-x64/bin.js'
}
Node.js v22.14.0
language-server@next is entirely unusable for me in emacs and just crashes constantly with stuff like:
Error: Command failed: <project path>/node_modules/.pnpm/@[email protected]/node_modules/@rescript/linux-x64/bin/rescript-editor-analysis.exe hover SomeFileInTheProject.res 22 16 /tmp/rescript_format_file_11770_2 false
at genericNodeError (node:internal/errors:983:15)
at wrappedFn (node:internal/errors:537:14)
at checkExecSyncError (node:child_process:882:11)
at Object.execFileSync (node:child_process:918:15)
at Rt (~/.local/share/pnpm/global/5/.pnpm/@[email protected]/node_modules/@rescript/language-server/out/cli.js:40:6642)
at lt (~/.local/share/pnpm/global/5/.pnpm/@[email protected]/node_modules/@rescript/language-server/out/cli.js:40:6854)
at jw (~/.local/share/pnpm/global/5/.pnpm/@[email protected]/node_modules/@rescript/language-server/out/cli.js:46:6748)
at wi.Ry [as callback] (~/.local/share/pnpm/global/5/.pnpm/@[email protected]/node_modules/@rescript/language-server/out/cli.js:46:16936)
at Object.thunk (~/.local/share/pnpm/global/5/.pnpm/@[email protected]/node_modules/@rescript/language-server/out/cli.js:3:547) {
status: null,
signal: 'SIGSEGV',
output: [ null, <Buffer >, <Buffer > ],
pid: 12135,
stdout: <Buffer >,
stderr: <Buffer >
1.64 works fine (with npm and bun, but not pnpm)
ok, i got something working:
- i need beta 13 (12 not working, might be https://github.com/rescript-lang/rescript/pull/7889 that fixes it?)
- i need to install
@rescript/linux-x64@ciin the project - i use
@rescript/language-server@next(1.65.0-next-c1b3031.0)
this seems to work with only intermittent crashes, and also i get a warning during startup:
⛔ Warning (lsp-mode): Unknown notification: rescript/compilationStatus
other than that, it's actually functional
i need to install @rescript/linux-x64@ci in the project
I would expect that is no longer a requirement.
Does your compiler-info.json look fine? Can you post that?
i need to install @rescript/linux-x64@ci in the project
I would expect that is no longer a requirement. Does your
compiler-info.jsonlook fine? Can you post that?
i think it's needed, or at least it wouldn't work until i installed it..
{
"version": "12.0.0-beta.13",
"bsc_path": "<project path>/node_modules/.pnpm/@[email protected]/node_modules/@rescript/linux-x64/bin/bsc.exe",
"bsc_hash": "1841d2f845430dd2e3448056c0dfb2c6710a9d9a447b11af781ed06c52c276c6",
"rescript_config_hash": "90bb8e2f7c795b12902b9b0cc0a7a76076cf19149bcc7f061334a63f55ff7d09",
"runtime_path": "<project path>/node_modules/.pnpm/@[email protected]/node_modules/@rescript/runtime",
"generated_at": "1759196003428"
}
does this look as it should?
does this look as it should?
It does, but that looks to me like you are using the @rescript+linux-x64 dependency from ReScript and not the explicit install.
@DZakh does it work for you now? Can we close this?
does this look as it should?
It does, but that looks to me like you are using the
@rescript+linux-x64dependency from ReScript and not the explicit install.@DZakh does it work for you now? Can we close this?
i just tried pnpm removing the @rescript/linux-x64@ci package and the lsp immediately stops working with this again:
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '<project path>/node_modules/@rescript/linux-x64/bin.js' imported from ~/.local/share/pnpm/global/5/.pnpm/@[email protected]/node_modules/@rescript/language-server/out/cli.js
at finalizeResolution (node:internal/modules/esm/resolve:275:11)
at moduleResolve (node:internal/modules/esm/resolve:860:10)
at defaultResolve (node:internal/modules/esm/resolve:984:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:685:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:634:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:617:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:273:38)
at onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:577:36)
at TracingChannel.tracePromise (node:diagnostics_channel:344:14)
at ModuleLoader.import (node:internal/modules/esm/loader:576:21) {
code: 'ERR_MODULE_NOT_FOUND',
url: 'file://<project path>/node_modules/@rescript/linux-x64/bin.js'
}
compiler-info.json:
{
"version": "12.0.0-beta.13",
"bsc_path": "<repo root>/node_modules/.pnpm/@[email protected]/node_modules/@rescript/linux-x64/bin/bsc.exe",
"bsc_hash": "1841d2f845430dd2e3448056c0dfb2c6710a9d9a447b11af781ed06c52c276c6",
"rescript_config_hash": "29abb8a0969242d5b126e9717c2ef29c52287a236b4aaf3258d1be9b212c0a13",
"runtime_path": "<repo root>/node_modules/.pnpm/@[email protected]/node_modules/@rescript/runtime",
"generated_at": "1759373668071"
}
is this because its a monorepo? project path != repo root
Thanks, for this report, I can see where things can still go wrong with pnpm.
@tx46 can you give 1.65.9 a spin?
@DZakh can we close this?
Going to close this, please open a new issue if related problems pop up.