libcurl error when using htmlwidgets::saveWidget along with plotly::partial_bundle without an internet connection
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 68/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- Active
- Stack technique
- plotly, r
- Domaine
- data-visualization, networking
Piste de recherche
Commencez par plotly::partial_bundle et verify_partial_bundle, qui apparaissent dans la pile d'erreurs, et reproduisez l'exemple avec htmlwidgets::saveWidget hors ligne. Suivez l'appel à curl::curl_download pour le bundle CDN et examinez les tests ou exemples existants autour de ces points d'entrée. C'est terminé lorsque le workflow hors ligne signalé présente un comportement défini et vérifié, sans l'erreur de résolution du nom d'hôte.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Running the ?plotly::partial_bundle example without an internet connection available results in the below error.
I think it used to work without accessing https://cdn.plot.ly ?
As a workaround I'm now using curl::has_internet to check whether I can use partial_bundle.
Example:
library(plotly)
p <- plot_ly(x = 1:10, y = 1:10) %>% add_markers()
save_widget <- function(p, f) {
owd <- setwd(dirname(f))
on.exit(setwd(owd))
htmlwidgets::saveWidget(p, f)
mb <- round(file.info(f)$size / 1e6, 3)
message("File is: ", mb," MB")
}
f1 <- tempfile(fileext = ".html")
f2 <- tempfile(fileext = ".html")
save_widget(p, f1)
save_widget(partial_bundle(p), f2)
Error:
Error in curl::curl_download(paste0("https://cdn.plot.ly/", bundle_script), :
Could not resolve hostname [cdn.plot.ly]:
Could not resolve host: cdn.plot.ly
11.
stop(e)
10.
raise_libcurl_error(6L, "Could not resolve hostname", "Could not resolve host: cdn.plot.ly",
"https://cdn.plot.ly/plotly-basic-2.25.2.min.js", NULL)
9.
curl::curl_download(paste0("https://cdn.plot.ly/", bundle_script),
tmpfile)
8.
verify_partial_bundle(p)
7.
plotly_build.plotly(p)
6.
plotly_build(p)
5.
htmlwidgets::saveWidget(p, f)
4.
x$elementId %||% paste("htmlwidget", createWidgetId(), sep = "-")
3.
toHTML(widget, standalone = TRUE, knitrOptions = knitrOptions)
2.
htmlwidgets::saveWidget(p, f)
1.
save_widget(partial_bundle(p), f2)
sessionInfo:
R version 4.6.1 (2026-06-24 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 10 x64 (build 19045)
Matrix products: default
LAPACK version 3.12.1
locale:
[1] LC_COLLATE=German_Germany.utf8 LC_CTYPE=German_Germany.utf8 LC_MONETARY=German_Germany.utf8 LC_NUMERIC=C
[5] LC_TIME=German_Germany.utf8
time zone: Europe/Berlin
tzcode source: internal
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] htmlwidgets_1.6.4 plotly_4.12.1 ggplot2_4.0.3 shiny_1.14.0
loaded via a namespace (and not attached):
[1] sass_0.4.10 generics_0.1.4 tidyr_1.3.2 digest_0.6.39 magrittr_2.0.5 evaluate_1.0.5
[7] grid_4.6.1 RColorBrewer_1.1-3 fastmap_1.2.0 jsonlite_2.0.0 promises_1.5.0 httr_1.4.8
[13] purrr_1.2.2 crosstalk_1.2.2 viridisLite_0.4.3 scales_1.4.0 jquerylib_0.1.4 cli_3.6.6
[19] rlang_1.3.0 withr_3.0.3 cachem_1.1.0 yaml_2.3.12 otel_0.2.0 tools_4.6.1
[25] memoise_2.0.1 dplyr_1.2.1 httpuv_1.6.17 curl_8.0.0 vctrs_0.7.3 R6_2.6.1
[31] mime_0.13 lifecycle_1.0.5 fontawesome_0.5.3 pkgconfig_2.0.3 pillar_1.11.1 bslib_0.12.0
[37] later_1.4.8 gtable_0.3.6 data.table_1.18.6.1 glue_1.8.1 Rcpp_1.1.2 xfun_0.60
[43] tibble_3.3.1 tidyselect_1.2.1 rstudioapi_0.19.0 knitr_1.51 farver_2.1.2 xtable_1.8-8
[49] htmltools_0.5.9 rmarkdown_2.31 compiler_4.6.1 S7_0.2.2
- Langage dominant
- R
- Étoiles
- 2.7k
- Forks
- 641
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de plotly/plotly.R
-
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
-
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
-
Data gets dropped in add_trace and consequently points have the wrong color if NA is presentOuverte
Difficulté 3/5 1-2 jours Accessibilité débutants 72/100
-
save_image ErrorOuverte
Difficulté 3/5 1-2 jours Accessibilité débutants 52/100
-
Difficulté 3/5 1-2 jours Accessibilité débutants 62/100
Toutes les issues de plotly/plotly.R
Issues similaires
-
documentation
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
pharmaverse/admiral#3196 ·
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 85/100
epiforecasts/inc2prev#69 ·
Les mainteneurs répondent en général sous 1 jour
-
feature-request
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
REditorSupport/vscode-R#1793 · 3 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-2 jours Accessibilité débutants 75/100
epiverse-trace/epiparameter#513 ·
Les mainteneurs répondent en général sous 1 jour