Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems when installing packages with yarn #126

Open
nlfiedler opened this issue Sep 1, 2018 · 7 comments
Open

Problems when installing packages with yarn #126

nlfiedler opened this issue Sep 1, 2018 · 7 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@nlfiedler
Copy link

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.

@jaredly
Copy link
Owner

jaredly commented Sep 3, 2018

Hmmm that's not a very helpful error message :/

I just released version 1.0.4 -- could you try with that? I cloned reductive & it worked just fine.

@nlfiedler
Copy link
Author

nlfiedler commented Sep 3, 2018

Thanks for looking int to. I'm attaching the log file, after quitting, deleting the file, and starting VS Code again, so it's as small as I can make it. As I said earlier, it was working and suddenly stopped working. I assume there's something subtle and mysterious that I did to mess it up. My question is, what do I do to clear the cache or whatever so it works again? I really want this to work because the other reason extension gets hung up on my "syntax errors" much too often.

debug.log

P.S. I tried 1.0.4, didn't make any difference. But thanks for updating this great extension.

@jaredly
Copy link
Owner

jaredly commented Sep 4, 2018

Hmm @nlfiedler that error message means "we couldn't find the ./lib directory". Is it there?

@nlfiedler
Copy link
Author

@jaredly I have figured it out. It was indeed the change I made earlier, and that was to switch from npm to yarn for use with reductive. When I first cloned reductive I was not yet familiar with yarn, so I used npm i instead. Everything was fine. Eventually I switched to yarn, so I cleared everything away and ran yarn. That's when the trouble started. I think what "fixed" it this time was that I removed everything, including node_modules, and ran npm i to fetch and rebuild everything. Whatever yarn is doing, it's not sufficient for reason-vscode.

@nlfiedler
Copy link
Author

Just to be sure, I removed the build artifacts and node_modules, then ran yarn cache clean, and yarn --force install, opened VS Code; still not happy. Closed VS Code, deleted everything, ran npm i, opened VS Code, and it's happy. Nothing installed in yarn globally. For npm, I have [email protected] and [email protected] installed globally. Not sure if that makes a difference.

@jaredly
Copy link
Owner

jaredly commented Sep 6, 2018

ooh, thanks for figuring out the cause!

@jaredly jaredly changed the title Insists that I run bsb again, cannot clear the condition Problems when installing packages with yarn Sep 6, 2018
@jaredly jaredly added bug Something isn't working help wanted Extra attention is needed labels Oct 7, 2018
@MoOx
Copy link
Contributor

MoOx commented Mar 27, 2019

I am using yarn with this plugin & never got any issue. @jaredly it seems the situation is better now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants