### Bug description


## Description

This is only happening on my Apple M1 (Big Sur). Works fine on RStudio Cloud. I am using Quarto version 1.2.269. Clean install of most recent R.

When a child Rmd with a `gt()` call is in a subdirectory **and** a file with the same name is **not** in root, then Quarto render to html or Word fails with a "file cannot be opened" error. 
* Does not happen with output to pdf. 
* Only happens if child is in a subdirectory.
* Only happens if a file with the same name is not in root. So if `figures/child_indir.Rmd` was renamed to `figures/child.Rmd`, it works
* Does not happen if the `gt()` call is commented out.  Seems very `gt()` and Mac specific.
* That the child is Rmd instead of qmd doesn't matter; same behavior if file ending changed to qmd.
* Works on RStudio Cloud (R 4.2.1) with both Quarto version 1.1.251 and version 1.2.269
* Clean install of R 4.2.2 and only packages need for this minimal example installed.
* Doesn't matter how I render via RStudio or `quarto render test.qmd` from terminal
* Does not happen if I change test.qmd to test.Rmd and use `rmarkdown::render("test.Rmd")`. Seems `quarto render` specific.

Quarto version v1.2.269 pre-release

## Reproducible example

File structure:
test.qmd
child.Rmd
figures/child_indir.Rmd

test.qmd
<pre>
---
format: html
---

# Works

```{r}
gt::gt(head(mtcars))
```

# This is what causes the error

```{r child="figures/child_indir.Rmd"}
```

# Works

```{r child="child.Rmd"}
```
</pre>

child.Rmd and figures/child_indir.Rmd. **These must have different names!** Below is all that is in the file. The `gt()` is the problem. Commenting that out or replacing with any other code (e.g. `flextable()`) causes the problem to go away.
<pre>
```{r}
gt::gt(head(mtcars))
```
</pre>

Error output is
<pre>
Quitting from lines 2-3 (/Users/eli.holmes/Desktop/deleteme3/figures/child_indir.Rmd) 
Quitting from lines NA-3 (/Users/eli.holmes/Desktop/deleteme3/figures/child_indir.Rmd) 
Error in readLines(con, warn = FALSE) : cannot open the connection
Calls: .main ... <Anonymous> -> enumerate_output_formats -> read_utf8 -> readLines
</pre>

## Expected result

The html or Word file should be produced.

## Session info

<pre>
> sessionInfo()
> sessionInfo()
R version 4.2.2 (2022-10-31)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Big Sur 11.6.2

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods  
[7] base     

loaded via a namespace (and not attached):
 [1] pillar_1.8.1     compiler_4.2.2   bslib_0.4.1     
 [4] jquerylib_0.1.4  tools_4.2.2      digest_0.6.30   
 [7] jsonlite_1.8.3   evaluate_0.18    lifecycle_1.0.3 
[10] tibble_3.1.8     gtable_0.3.1     pkgconfig_2.0.3 
[13] rlang_1.0.6      cli_3.4.1        yaml_2.3.6      
[16] xfun_0.34        fastmap_1.1.0    withr_2.5.0     
[19] dplyr_1.0.10     stringr_1.4.1    knitr_1.40      
[22] generics_0.1.3   vctrs_0.5.0      sass_0.4.2      
[25] grid_4.2.2       tidyselect_1.2.0 glue_1.6.2      
[28] R6_2.5.1         fansi_1.0.3      rmarkdown_2.18  
[31] ggplot2_3.4.0    magrittr_2.0.3   scales_1.2.1    
[34] htmltools_0.5.3  gt_0.7.0         colorspace_2.0-3
[37] utf8_1.2.2       stringi_1.7.8    munsell_0.5.0   
[40] cachem_1.0.6    
</pre>


### Checklist

- [X] Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
- [X] Please [format your issue](https://quarto.org/bug-reports.html#formatting-make-githubs-markdown-work-for-us) so it is easier for us to read the bug report.
- [X] Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [X] Please document the operating system you're running. If on Linux, please provide the specific distribution.
cscheid
2022-11-10T17:25:27Z
eeholmes
bug tables
closed
Quarto render throws 'file not found' error with child Rmd/qmd with gt()
https://github.com/quarto-dev/quarto-cli/issues/3274