Skip to content

Error with GitHub Actions while building the function reference with S3 method #3041

Done

Description

@basille

Hi,

I'm unable to wrap my head around this issue, so please bear with me and do not hesitate to ask for further details or tests.

I'm developing a simple package called mab, which includes a new method for stats::na.omit on objects of class adehabitatLT::ltraj. The function is thus simply called na.omit.ltraj. The function na.omit.ltraj includes the following directives to respectively declare the method it expands on and explicitly declare on which class it works (to disambiguate the double period in the name), as well as explicitly giving a name to the doc file:

#' @exportS3Method stats::na.omit
#' @method na.omit ltraj
#' @name na.omit.ltraj

With this, it seems unnecessary to import/depend on stats (in DESCRIPTION), and all checks (with devtools::check()) are fine.

Now, I've added a custom reference list in _pkgdown.yml, with:

reference:
- title: ltraj management
  desc: Management of ltraj (adehabitatLT)
- contents:
  […]
  - na.omit.ltraj

I'm able to build the site for GitHub Pages with no issue with pkgdown::build_site_github_pages(), here's the excerpt related to the reference:

── Building function reference ────────────────────────────────────────────────────────────────────────
Writing `reference/index.html`
[…]
Reading man/na.omit.ltraj.Rd
Writing `reference/na.omit.ltraj.html`

However, the pkgdown action (as built by usethis::use_pkgdown_github_pages())) fails with the following error (relevant excerpt):

── Building function reference ─────────────────────────────────────────────────
Error in `build_reference_index()`:
! In _pkgdown.yml, reference[2].contents[6] (na.omit.ltraj) must be a
  known topic name or alias.
Backtrace:
     ▆
  1. └─pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
  2.   └─pkgdown::build_site(...)
  3.     └─pkgdown:::build_site_local(...)
  4.       └─pkgdown::build_reference(...)
  5.         └─pkgdown::build_reference_index(pkg)
  6.           ├─pkgdown::render_page(...)
  7.           │ └─pkgdown:::render_page_html(pkg, name = name, data = data, depth = depth)
  8.           │   └─pkgdown:::modify_list(data_template(pkg, depth = depth), data)
  9.           └─pkgdown:::data_reference_index(pkg)
 10.             ├─pkgdown:::unwrap_purrr_error(...)
 11.             │ └─base::withCallingHandlers(...)
 12.             └─purrr::imap(meta, data_reference_index_rows, pkg = pkg, call = error_call)
 13.               └─purrr::map2(.x, vec_index(.x), .f, ...)
 14.                 └─purrr:::map2_("list", .x, .y, .f, ..., .progress = .progress)
 15.                   ├─purrr:::with_indexed_errors(...)
 16.                   │ └─base::withCallingHandlers(...)
 17.                   ├─purrr:::call_with_cleanup(...)
 18.                   └─pkgdown (local) .f(.x[[i]], .y[[i]], ...)
 19.                     └─pkgdown:::section_topics(...)
 20.                       └─pkgdown:::select_topics(...)
 21.                         ├─pkgdown:::unwrap_purrr_error(...)
 22.                         │ └─base::withCallingHandlers(...)
 23.                         └─purrr::imap(...)
 24.                           └─purrr::map2(.x, vec_index(.x), .f, ...)
 25.                             └─purrr:::map2_("list", .x, .y, .f, ..., .progress = .progress)
 26.                               ├─purrr:::with_indexed_errors(...)
 27.                               │ └─base::withCallingHandlers(...)
 28.                               ├─purrr:::call_with_cleanup(...)
 29.                               └─pkgdown (local) .f(.x[[i]], .y[[i]], ...)
 30.                                 └─pkgdown:::topic_must(...)
 31.                                   └─pkgdown:::config_abort(error_pkg, msg, call = error_call, ...)
 32.                                     └─cli::cli_abort(message, ..., call = call, .envir = .envir)
 33.                                       └─rlang::abort(...)

I'm obviously missing something, but after checking resources such as the pkgdown documentation, the R Packages book and trying many searches on the web, I fail to find a solution. Any idea?

Activity

  1. basille commented on Nov 30, 2026

    @basille
    Author

    Oh well, apparently, this is because I forgot to add the corresponding .Rd file in the Git commit…
    Problem solved then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions