You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Quarto添加server: shiny时报错:object 'html' not found

解决Quarto添加server: shiny后报错object 'html' not found的方案
  • 修正YAML格式定义
    该错误多因YAML中输出格式的写法不规范导致。如果你的YAML里写了output: html,请替换为Quarto标准写法:

    format: html
    server: shiny
    

    若坚持用output字段,需指定完整的R Markdown输出格式名称:

    output: html_document
    server: shiny
    
  • 清理编译缓存与R环境

    1. 运行R命令清除当前环境变量:
      rm(list = ls())
      gc()
      
    2. 删除文档所在目录下的_freeze、_site缓存文件夹,重新编译文档。
  • 检查Quarto环境兼容性
    在终端执行quarto check命令,查看Quarto、Shiny及相关依赖的状态,根据提示更新到最新稳定版本,避免版本兼容问题。

  • 简化文档定位问题
    先使用最简测试文档验证环境是否正常:

    ---
    title: "Shiny Test"
    format: html
    server: shiny
    ---
    
    ```{r}
    sliderInput("num", "选择数值", 1, 100, 50)
    plotOutput("plot")
    
    output$plot <- renderPlot({
      hist(rnorm(input$num))
    })
    

    若该测试文档能正常运行,再逐步添加原有内容,排查引发错误的代码段。

内容的提问来源于stack exchange,提问作者LMc

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.19 15:12:16