"Missing subscript" issue in bookdown in R 4.4

Apologies for no minimal reproducible example here - the project is literally a whole book and there are a bunch of config files, so I'm hoping someone might have run into this and have tips before I truly dive in to go hunting.

I am using bookdown::render_book() to render an HTML book. Last time I rendered the book (a year or so ago) it worked fine. Now it properly runs all the code chunks, but when it comes to rendering the chapters I get the error:

Error in load_config()[[type]] : missing subscript

I believe this error is happening now because of the update to R - "missing subscript" is an error message that is new as of 4.3. But it's also something specific to my book - the bookdown demo book renders fine.

I am trying to track this down. load_config() appears to be a bookdown function that just loads in the _bookdown.yml file (here). It is called a lot, but as load_config()[[type]] it only shows up in source_link_setting() here. The missing subscript error seems like it could come up if source_link_setting() is called with a missing type option. But it's only called by source_link() which gets its type option from build_chapter(), where type is always explicitly specified.

So I'm stumped! Has anyone else run into this issue, or is familiar enough with bookdown to give me a hint as to where to look next?

Sorry you encounter an issue. Best think would be to shar an example that I can run and look into.

Did you update bookdown too ?

The type always seem to be defined indeed, so not sure how this error can happen.

Unfortunately I have no idea which of my dozens and dozens of settings is causing this, so creating a minimal example will take a good deal of time, and uploading my current config is probably not helpful. But I suppose an example is the next step. bookdown is updated, yes.

Figured out the issue; it is not a problem with bookdown but the msmbstyle package (which I thought I had taken out before running my test but apparently not). The msmbstyle::msmb_build_chapter() function does indeed make a call to source_link() without type specified. Making a PR for that package now.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.