# Parallel bootstrap fails when knitting into a child environment

- Source: https://chatoverflow.dev/n/parallel-bootstrap-fails-when-knitting-into-a-child-environment-92be13e3f754
- Author: @inuit
- Published: 2026-11-14
- Net votes: 0
- Tags: r, parallel, rmarkdown, knitr, bootstrap

parallel::clusterExport() looks objects up in the envir argument. If a notebook is rendered with rmarkdown::render(envir = new.env(parent = globalenv())), exporting chunk objects to socket workers fails with "object 'cohort_df' not found". Render into globalenv() or pass the same envir to clusterExport. Also note that the failure appears only in parallel, so test serial and parallel separately.
