Quarto documents ignores #| echo: false in R code blocks when rendering

My simple quarto code looks like this:

---
title: 02 Modeling
description: First steps in data analysis

number-sections: true
format:
  html:
    embed-resources: true
#jupyter:
#  kernel: "ir"
---

## Load Libraries & Data

```{r}
#| echo: false

if (!requireNamespace("pacman", quietly = TRUE)) {
  install.packages("pacman", repos = "https://cran.rstudio.com/")
}

# Mit pacman alle benötigten Pakete installieren und laden
pacman::p_load(tidyr, dplyr, ggplot2, readr, lubridate, tibble, stringr, openxlsx, 
              jsonlite, purrr, knitr, kableExtra, stargazer, readxl, broom, 
              forecast, fixest, gt, splines, sandwich, lmtest, readxl)

My HTML results still show the code of my codeblock, ignoring the following:

#| echo: false

Also I am wondering why the code block numbers are shown.. I am not using jupyter as kernel

Do this outside of Quarto

if (!requireNamespace("pacman", quietly = TRUE)) {
  install.packages("pacman", repos = "https://cran.rstudio.com/")
}

# Mit pacman alle benötigten Pakete installieren und laden
pacman::p_load(tidyr, dplyr, ggplot2, readr, lubridate, tibble, stringr, openxlsx, 
              jsonlite, purrr, knitr, kableExtra, stargazer, readxl, broom, 
              forecast, fixest, gt, splines, sandwich, lmtest, readxl)

I can also do it outside of quarto, however, it doesn't solve my main issue here which is that

#| echo: false

is ignored when rendering

Well., so much for my first guess.

Is the above code everything in the document?

Try this

pak::p_load("XML", "devtools", "RCurl", "fakePackage", "SPSSemulate", 
              "tidyr", "dplyr", "ggplot2", "readr", "lubridate", "tibble", "stringr", 
               "openxlsx", "jsonlite", "purrr", "knitr", "kableExtra", 
              "stargazer", "readxl", "broom", "forecast", 
              "fixest", "gt", "splines", "sandwich", "lmtest", "readxl")


or this:

install.packages("XML", "devtools", "RCurl", "fakePackage", "SPSSemulate", 
              "tidyr", "dplyr", "ggplot2", "readr", "lubridate", "tibble", "stringr", 
               "openxlsx", "jsonlite", "purrr", "knitr", "kableExtra", 
              "stargazer", "readxl", "broom", "forecast", 
              "fixest", "gt", "splines", "sandwich", "lmtest", "readxl")

but I don't think I can help at the moment as I am getting warnings that

  package ‘SPSSemulate’ is not available for this version of R

A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
> pak::pkg_install("XML", "devtools", "RCurl", "fakePackage")

``
and I'll have to sort them out.

However this is working fine for me.

pak::pkg_install('lmtest')

Looks like Quarto manuscripts output, is this what you are working with?
What's in your project file, _quarto.yml, and index.qmd ? Do you have same issues with stand-alone qmd files that are not stored somewhere in manuscripts project?

Yes, exactly, I am working with a manuscript project in Quarto.

My _quarto.yml document contains:

project:
  type: manuscript

execute:
  freeze: auto

format:
  html:
    toc: true
    comments:
      hypothesis: true
  docx: default
  jats: default
  agu-pdf: default

and my index file starts with

---
title: "XX"
author:
  - name: Robert
date: last-modified
bibliography: references.bib
csl: apa.csl 
citation:
  container-title: XX
number-sections: true
#jupyter: python3
---

I just rendered a standalone .qmd-file and everything works just fine. It seems like the issue occurs in the project setup only.

I think your problem is in your YANL. Take out
execute:
freeze: auto