Skip to main content

Component module outside the project

components
A component’s src resolves to a file outside the project, so it cannot be copied into the output. The element keeps its static content.

Q-25-2 — Component module outside the project

A component’s src resolves to a file outside the project, so it cannot be copied into the output. The element keeps its static content.

What this means

A component’s module is copied under the output’s site_libs/ directory and linked from the page, the way a css: stylesheet is. A src such as ../../shared/counter.js that escapes the project root has no place in the output tree, so Quarto warns and ships nothing for that component. The bound element still renders as plain markup.

Why this happens

  • src: climbs out of the project with ...
  • The project root is not where you think it is (the directory with _quarto.yml, or the document’s directory for a single-file render).

How to fix

Move the module into the project, or symlink it there, and point src: at that location.