Pkgdown: Error: Context `topic_index` has not been initialised

Created on 21 Jun 2017  路  11Comments  路  Source: r-lib/pkgdown

I am getting Error: Contexttopic_indexhas not been initialised when running build_site() on my package eulerr.

Creating 'C:\Users\johan\Documents\GitHub\eulerr\docs/'
Copying 'C:/Users/johan/Documents/R/win-library/3.4/pkgdown/assets/jquery.sticky-kit.min.js'
Copying 'C:/Users/johan/Documents/R/win-library/3.4/pkgdown/assets/link.svg'
Copying 'C:/Users/johan/Documents/R/win-library/3.4/pkgdown/assets/pkgdown.css'
Copying 'C:/Users/johan/Documents/R/win-library/3.4/pkgdown/assets/pkgdown.js'
Building home --------------------------------------------------------------------
Writing 'C:\Users\johan\Documents\GitHub\eulerr\docs/LICENSE.html'
Writing 'C:\Users\johan\Documents\GitHub\eulerr\docs/authors.html'
Updating README.md
Building article 'index.html'
Error: Context `topic_index` has not been initialised

Here's my devtools::session_info():

Session info --------------------------------------
 setting  value                                      
 version  R version 3.4.0 Patched (2017-05-25 r72739)
 system   x86_64, mingw32                            
 ui       RStudio (1.0.143)                          
 language (EN)                                       
 collate  English_United States.1252                 
 tz       Europe/Berlin                              
 date     2017-06-21                                 

Packages ------------------------------------------
 package    * version    date       source                          
 assertthat   0.2.0      2017-04-11 CRAN (R 3.4.0)                  
 backports    1.1.0      2017-05-22 CRAN (R 3.4.0)                  
 base       * 3.4.0      2017-05-27 local                           
 callr        1.0.0.9000 2017-06-21 Github (r-pkgs/callr@ddd24a3)   
 commonmark   1.2        2017-03-01 CRAN (R 3.4.0)                  
 compiler     3.4.0      2017-05-27 local                           
 crayon       1.3.2      2016-06-28 CRAN (R 3.3.1)                  
 curl         2.6        2017-04-27 CRAN (R 3.4.0)                  
 datasets   * 3.4.0      2017-05-27 local                           
 debugme      1.0.2      2017-03-01 CRAN (R 3.4.0)                  
 desc         1.1.0      2017-01-27 CRAN (R 3.4.0)                  
 devtools   * 1.13.2     2017-06-02 CRAN (R 3.4.0)                  
 digest       0.6.12     2017-01-27 CRAN (R 3.4.0)                  
 eulerr     * 2.0.0      <NA>       local                           
 evaluate     0.10       2016-10-11 CRAN (R 3.3.1)                  
 git2r        0.18.0     2017-01-01 CRAN (R 3.4.0)                  
 graphics   * 3.4.0      2017-05-27 local                           
 grDevices  * 3.4.0      2017-05-27 local                           
 grid         3.4.0      2017-05-27 local                           
 highlight    0.4.7.1    2017-03-21 CRAN (R 3.4.0)                  
 htmltools    0.3.6      2017-04-28 CRAN (R 3.4.0)                  
 httr         1.2.1      2016-07-03 CRAN (R 3.3.1)                  
 knitr        1.16       2017-05-18 CRAN (R 3.4.0)                  
 lattice      0.20-35    2017-03-25 CRAN (R 3.4.0)                  
 magrittr     1.5        2014-11-22 CRAN (R 3.3.1)                  
 MASS         7.3-47     2017-04-21 CRAN (R 3.4.0)                  
 memoise      1.1.0      2017-04-21 CRAN (R 3.4.0)                  
 methods    * 3.4.0      2017-05-27 local                           
 pkgbuild     0.0.0.9000 2017-04-23 Github (r-pkgs/pkgbuild@8aab60b)
 pkgdown    * 0.1.0.9000 2017-06-21 Github (hadley/pkgdown@74889ca) 
 pkgload      0.0.0.9000 2017-06-21 Github (r-lib/pkgload@119cf9a)  
 processx     2.0.1      2017-06-21 Github (r-lib/processx@4bf780f) 
 purrr        0.2.2.2    2017-05-11 CRAN (R 3.4.0)                  
 R6           2.2.2      2017-06-17 CRAN (R 3.4.0)                  
 Rcpp         0.12.11    2017-05-22 CRAN (R 3.4.0)                  
 rlang        0.1.1.9000 2017-06-21 Github (hadley/rlang@d92dbde)   
 rmarkdown    1.6        2017-06-15 CRAN (R 3.4.0)                  
 roxygen2     6.0.1      2017-02-06 CRAN (R 3.4.0)                  
 rprojroot    1.2        2017-01-16 CRAN (R 3.4.0)                  
 stats      * 3.4.0      2017-05-27 local                           
 stringi      1.1.5      2017-04-07 CRAN (R 3.4.0)                  
 stringr      1.2.0      2017-02-18 CRAN (R 3.4.0)                  
 testthat     1.0.2.9000 2017-04-27 Github (hadley/testthat@b72a228)
 tibble       1.3.3      2017-05-28 CRAN (R 3.4.0)                  
 tools        3.4.0      2017-05-27 local                           
 usethis      0.0.0.9000 2017-05-15 Github (r-pkgs/usethis@6dca914) 
 utils      * 3.4.0      2017-05-27 local                           
 whisker      0.3-2      2013-04-28 CRAN (R 3.3.1)                  
 withr        1.0.2      2016-06-20 CRAN (R 3.3.1)                  
 xml2         1.1.1      2017-01-24 CRAN (R 3.4.0)                  
 yaml         2.1.14     2016-11-12 CRAN (R 3.4.0)   

Most helpful comment

Ah, I accidentally made it rely on you having the package loaded with devtools. I'll work on a fix.

All 11 comments

Should be fixed now

I am still getting the same error.

likewise getting same error.

In my case I'm getting a little further in the build process - to the function references

pkgdown::build_site()
Initialising site --------------------------------------------------------------------------
Copying 'C:/Users/devin/Documents/R/win-library/3.4/pkgdown/assets/jquery.sticky-kit.min.js'
Copying 'C:/Users/devin/Documents/R/win-library/3.4/pkgdown/assets/link.svg'
Copying 'C:/Users/devin/Documents/R/win-library/3.4/pkgdown/assets/pkgdown.css'
Copying 'C:/Users/devin/Documents/R/win-library/3.4/pkgdown/assets/pkgdown.js'
Building home ------------------------------------------------------------------------------
Writing 'C:UsersdevinDocumentsReposPKPDmiscdocs/LICENSE.html'
Writing 'C:UsersdevinDocumentsReposPKPDmiscdocs/authors.html'
Writing 'C:UsersdevinDocumentsReposPKPDmiscdocs/index.html'
Building function reference ----------------------------------------------------------------
Loading PKPDmisc
Writing 'C:UsersdevinDocumentsReposPKPDmiscdocs/reference/index.html'
Processing as_numeric.Rd

I've fallen back to hadley/pkgdown@b305b79 which fixes this error for me

I'll take another look

Ah, I accidentally made it rely on you having the package loaded with devtools. I'll work on a fix.

confirming it works now!

Hi Hadley,

This issue is popping up again for me with the latest pkgdown build. build_site_rstudio() is erroring out but build_site() works.

> pkgdown:::build_site_rstudio()
Error: Context `topic_index` has not been initialised
Execution halted

Error: Context `topic_index` has not been initialised

I haven't been using pkgdown prior to the current commit but I'm getting this error. The site builds as expected if no vignette *.Rmd files are present. I'll edit with a reprex when I get home.

I got this error today with the latest CRAN version of pkgdown (1.1.0).

FWIW, I fixed it by making sure my man/ directory wasn't empty by running usethis::use_package_doc() then usethis::use_tibble() and placing the following code in the package doc file in R/:

#' @keywords internal
"_PACKAGE"

#' @importFrom tibble tibble
NULL

This way the man/ folder isn't empty and pkgdown then builds correctly. Of course, this could be coincidence; it's hard to make a reproducible example for this problem.

I guess I have the same problem with 1.3.0. Maybe adding a slightly more informative error message would be the best way forward - why would you want a pkgdown site without any /man stuff?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

maelle picture maelle  路  6Comments

mjsteinbaugh picture mjsteinbaugh  路  7Comments

maelle picture maelle  路  6Comments

thierrygosselin picture thierrygosselin  路  9Comments

cderv picture cderv  路  9Comments