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
roxygenize error: "Caused by error in basename()
: a character vector argument expected"
#1589
Comments
Same issue here and I can't tell from the error which S3 method is missing a tag. |
I got the same issue, but no methods were missing tags. Restarting the R session made it go away... |
I restarted several times and it did not work. And then, did some work, restarted and it magically stopped throwing errors. |
The same issue is on GitHub Actions. How to solve it? Use the previous version of Roxygen2 where the issue was not present? |
Yes, you can work around it by reverting to roxygen2 version 7.2.3. Or, you can give up and add |
I just figured out when this happens for me. If I have a breakpoint setup inside a method, and I run document(), the above error would appear. Removing the breakpoint removes the error. There may be multiple causes of the same error, but this is what was causing it for me. Reproducible example: #' @export
summary.myclass <- function(object) {
cat("This is a summary of myclass\n")
} running and I run Error in `map2()`:
ℹ In index: 1.
ℹ With name: summary.myclass.
Caused by error in `basename()`:
! a character vector argument expected
Run `rlang::last_trace()` to see where the error occurred.
Warning message:
In class(f) <- c("s3method", "function") :
Setting class(x) to multiple strings ("s3method", "function", ...); result will no longer be an S4 object |
I've been successfully building my package documentation until now, up through roxygen2 7.2.3. But with version 7.3.0 and later, it fails:
Apparently one of my S3 methods is missing an
@export
tag, but since the warning message fails, I can't tell which one. Running again withdebug
helps to show what the trouble is:So
warn_roxy_function
is trying to create a warning message based onattr(fun, "srcref")
, but the attribute value is empty, which causes an error further down the line.The text was updated successfully, but these errors were encountered: