jaredly / jaredly/reason-language-server

Problems when installing packages with `yarn`

Open
#126 7 comments 1 reaction 0 assignees View on GitHub
bug help wanted
Dominant language
OCaml
Stars
649
Forks
85
PR merge metrics
No merged PRs in 30d

Description

Using VS Code 1.26.1 and reason-vscode 1.0.3 on macOS. It keeps insisting that I run bsb. It was fine yesterday. Since then I installed yarn via Homebrew, and deleted the `package-lock.json` file. Out of pure superstition, I ran `npm i` to get the `package-lock.json` back, but that didn't help. So how do I clean this thing ("thing" being whatever needs cleaning) so it works again?

The project in question is reductive, which has bsb 3.1.1 installed locally, if that matters. I happen to have bsb 4.0.5 installed globally via npm.

The last chunk of the `.lsp/debug.log` file:

```
Read message ^M
{"jsonrpc":"2.0","id":5,"method":"textDocument/codeLens","params":{"textDocument":{"uri":"file:///Users/nfiedler/proje\
cts/reductive/examples/react/TodoApp.re"}}}
Got a method textDocument/codeLens
>> Build system: /Users/nfiedler/projects/reductive/node_modules/bs-platform/lib/bsb.exe -make-world
ninja: no work to do.
ninja: no work to do.
ninja: Entering directory `lib/bs'
ninja: no work to do.
>> Error
Duplicated package: bs-platform /Users/nfiedler/projects/reductive/node_modules/bs-platform (chosen) vs /Users/nfiedle\
r/projects/reductive/node_modules/immutable-re/node_modules/bs-platform in /Users/nfiedler/projects/reductive/node_mod\
ules/immutable-re
Affected files
Cleaning bsconfig.json
Sending notification {"jsonrpc": "2.0", "method": "textDocument/publishDiagnostics", "params": {"uri": "file:///Users/\
nfiedler/projects/reductive/bsconfig.json", "diagnostics": []}}
Deps reason-react
Dep loc /Users/nfiedler/projects/reductive/node_modules/reason-react/bsconfig.json
Compiled base: /Users/nfiedler/projects/reductive/node_modules/reason-react/lib/ocaml
Source directories: /Users/nfiedler/projects/reductive/node_modules/reason-react/src
Source files found: /Users/nfiedler/projects/reductive/node_modules/reason-react/src/ReasonReactOptimizedCreateClass.r\
e : /Users/nfiedler/projects/reductive/node_modules/reason-react/src/ReactEventRe.rei : /Users/nfiedler/projects/reduc\
tive/node_modules/reason-react/src/ReactDOMRe.re : /Users/nfiedler/projects/reductive/node_modules/reason-react/src/Re\
actDOMServerRe.re : /Users/nfiedler/projects/reductive/node_modules/reason-react/src/ReactEventRe.re : /Users/nfiedler\
/projects/reductive/node_modules/reason-react/src/ReasonReact.rei : /Users/nfiedler/projects/reductive/node_modules/re\
ason-react/src/ReasonReact.re
With compiled base:
Sending response {"id": 5, "jsonrpc": "2.0", "result": [{"range": {"start": {"line": 0, "character": 0}, "end": {"line\
": 0, "character": 0}}, "command": {"title": "Unable to load compilation data: You need to run bsb first so that reaso\
n-language-server can access the compiled artifacts.\nOnce you've run bsb, restart the language server.", "command": "\
"}}]}
```

Thanks for this extension, it's been really nice so far.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the duplicated bs-platform error and the build-system output in .lsp/debug.log, then inspect the referenced bsconfig.json and node_modules paths. Reproduce the package installation state described for reductive and verify that the language server no longer prompts for bsb or reports duplicated packages.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, ocaml, vscode
Domain
devtools, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.