Error while running `devtools::document()`in R-devel on Linux

While testing the package with R-devel on Linux via GitHub Actions, the error occurs while trying to create/update documentation via devtools::document():

Error in nchar(xs) : 
  number of characters is not computable in "bytes" encoding, element 1

The error message is not informative and does not indicate which lines of code create the issue. How should I start debugging and fixing this?

On R-oldrelease and R-release this error is not present. On my Windows machine, R CDM check is successful. Summary of the issue in the image below, link to report is here

image

If you have any ideas, please, share.

2 Likes

+1

I have just met the same issue on devtools::test() using R-devel version:

$ R -q -e 'devtools::test()'
> devtools::test()
Error in nchar(xs) : 
  number of characters is not computable in "bytes" encoding, element 1
Calls: <Anonymous> ... <Anonymous> -> clii__xtext -> ansi_strwrap -> lapply -> FUN
Execution halted

@dorch, what OS do you use for testing?
Did you try testing locally or on continuous integration (CI) platform?
Can you give more details on your package? Is it on GitHub?

It's on a gitlab CI platform using the docker image rocker/verse:devel on a branch that is tested weekly.
It worked one week ago without changing anything except the docker image which has been updated the 8th of July. I have other pipelines running the same docker image on other branches that are OK, so maybe it's just an issue with the cache of the CI which contains the package library.

I'll try to reset the cache and see if it solves this problem and keep you in touch.

Deleting the cache which contains the package library and reinstalling all the packages solves this issue for me.

This topic was automatically closed 21 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.