paleolimbot / rbbt

R Interface to the Better BiBTex Zotero Connector
142 stars 25 forks source link

bbt_write_bib throwing "Error in `result$result[[3]]`" error #47

Open M1V0 opened 6 months ago

M1V0 commented 6 months ago

Hi,

I have an issue that has only started today affecting multiple previous working RMarkdown documents where I use bbt_write_bib to create bibliography files.

Now when trying to knit a RMarkdown document I get the error:

processing file: 09Discussion.Rmd
  |......................................................................| 100%
Quitting from lines 2-134 (09Discussion.Rmd)
Error in `result$result[[3]]`:
! subscript out of bounds
Backtrace:
 1. rbbt::bbt_write_bib("Bibliography/discussion.json", overwrite = TRUE)
 4. rbbt::bbt_bib(...)
 5. base (local) .action(result$result[[3]])

Execution halted

This is in R 4.2.2, pandoc 3.1.1, with rbbt 0.0.0.9 - the issue happens across multiple documents - even when the offending line is commented out and a reference to just bibliography: Bibliography/discussion.json is used. Deleting the rbbt line then allows that to render, but I need the overwrite function.

Thanks in advance and apologies if I'm missing any information.

dmi3kno commented 6 months ago

Something has changed in BBT interface. The resulting bib content is no longer in a third element of a vector, but rather in the first one.

Can one of the maintainers confirm the change in the returned BBT JSON and adjust this line https://github.com/paleolimbot/rbbt/blob/ec1ebe1e9b7e60bc4523e6cb2ca47f73a9cbfba3/R/bbt.R#L98

swalmsley commented 6 months ago

I am having the same issue. Would very much appreciate if this change could be made. Thanks!

mccarthy-m-g commented 6 months ago

I just ran into this as well. Fortunately @dmi3kno's comment lead me to an easy workaround: Until a change in rbbt is made you can just downgrade BBT, disable automatic updates for BBT, and things should work again.

I successively downgraded from the current version of BBT (v6.7.143) until the error went away at v6.7.140, so that seems to be the most recent version compatible with rbbt right now.

M1V0 commented 6 months ago

I replicated @mccarthy-m-g's workaround - so thank you! That saves me a headache when submitting my PhD next month.

bbartholdy commented 6 months ago

Can also confirm that BBT v6.7.140 works for me! Also saved my PhD dissertation! Thanks @mccarthy-m-g :smile:

peranti commented 5 months ago

Hi @bbartholdy @M1V0 @mccarthy-m-g, could you please advise me on how to install BBT v6.7.140? Many thanks!

nikitoshina commented 5 months ago

@peranti download .xpi file and follow the regular installation instructions.

heike commented 4 months ago

@wmoldham put in a pull request - that fixes the bug. Thank you @wmoldham! Until @paleolimbot is accepting the pull request, installing from the forked repo will fix things remotes::install_github("wmoldham/rbbt")

cjvanlissa commented 3 months ago

Stumbled upon this issue; I independently confirm this bug and my fix is the same as wmoldham's. Their PR can be accepted.

cpsyctc2 commented 4 days ago

I am not sufficiently knowledgeable about the internals to understand the comment from NewGraphEnvironment but I can confirm that the problem was still there with a copy of the package that I pulled from paleolimbot/rbbt yesterday but the problem goes away using wmoldham/rbbt (thanks for that heike and wmoldham). rbbt is so much better than the insert citations facility in "visual" Rstudio that I do hope it will continue to be maintained and even developed. I am happy to do testing on Linux (Ubuntu 22.04) and perhaps with suggestions for more documentation Windoze but I don't have skills for the programming. Huge thanks to all who have created it so far. Chris