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

Something went wrong parsing the json output of reanalyze: 'SyntaxError: Unexpected token W in JSON at position 4' #574

Closed
Ashesh3 opened this issue Sep 5, 2022 · 4 comments · Fixed by #575

Comments

@Ashesh3
Copy link

Ashesh3 commented Sep 5, 2022

Similar to #537

Parsing JSON from reanalyze failed. The raw, invalid JSON can be reproduced by following the instructions below. Please run that command and report the issue + failing JSON on the extension bug tracker: https://github.com/rescript-lang/rescript-vscode/issues
> To reproduce, run "/root/.vscode-server/extensions/chenglou92.rescript-vscode-1.7.6/server/analysis_binaries/linux/rescript-editor-analysis.exe reanalyze -json" in directory: "/root/project/src/Components/folder_1/folder_2"

I ran the above command and here's my output:

root@46a74b7bf5b6:~/project# cd /root/project/src/Components/folder_1/folder_2
root@46a74b7bf5b6:~/project/src/Components/folder_1/folder_2# /root/.vscode-server/extensions/chenglou92.rescript-vscode-1.7.6/server/analysis_binaries/linux/rescript-editor-analysis.exe reanalyze -json

[  Warning: can't find source dirs: /root/project/lib/bs/.sourcedirs.json
  Types for cross-references will not be found by genType.

]
root@46a74b7bf5b6:~/project/src/Components/folder_1/folder_2# 

Seems like the JSON generated is invalid?

@zth
Copy link
Collaborator

zth commented Sep 5, 2022

cc @cristianoc (the reporting mechanism actually works 😄 🎉 )

cristianoc added a commit that referenced this issue Sep 5, 2022
@cristianoc
Copy link
Collaborator

cc @cristianoc (the reporting mechanism actually works 😄 🎉 )

Indeed! Much faster to fix.

@cristianoc
Copy link
Collaborator

cristianoc commented Sep 5, 2022

@Ashesh3 as a side note would you check why .sourcedirs.json was not found? Did the project fail to compile? This file should be generated by the compiler.

@Ashesh3
Copy link
Author

Ashesh3 commented Sep 5, 2022

@Ashesh3 as a side note would you check why .sourcedirs.json was not found? Did the project fail to compile? This file should be generated by the compiler.

Yep, the build was never run before. Fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants