#symlinks in content collections in a monorepo

3 messages · Page 1 of 1 (latest)

low coral
#

Can I symlink files in content collections to other files within a monorepo?

When I try I get the following error
17:55:00 [build] Building static entrypoints...
17:55:01 [ERROR] [vite] x Build failed in 629ms
[UnknownContentCollectionError] [astro:content-imports]
file: C:/c/mono/apps/2000/src/content/docs/index.mdx?astroContentCollectionEntry=true
Error reference:
https://docs.astro.build/en/reference/errors/unknown-content-collection-error/
Stack trace:
at getEntryModuleBaseInfo (file:///C:/c/mono/node_modules/.pnpm/astro@4.15.4_@types+node@20.14.2_rollup@4.21.2_typescript@5.4.5/node_modules/astro/dist/content/vite-plugin-content-imports.js:239:36)
at async Object.transform (file:///C:/c/mono/node_modules/.pnpm/astro@4.15.4_@types+node@20.14.2_rollup@4.21.2_typescript@5.4.5/node_modules/astro/dist/content/vite-plugin-content-imports.js:89:67)
at async ModuleLoader.addModuleSource (file:///C:/c/mono/node_modules/.pnpm/rollup@4.21.2/node_modules/rollup/dist/es/shared/node-entry.js:19046:36)
 ELIFECYCLE  Command failed with exit code 1.

sand mulchBOT
#

Hi @low coral. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

The error you're encountering, UnknownContentCollectionError, is typically caused by certain errors inside your src/content/config.ts file or some internal errors. It's not explicitly stated in the Astro documentation whether symlinks are supported in content collections. However, given the error you're experiencing, it seems like there might be an issue with Astro recognizing or processing the symlinked files.

If you can reliably reproduce this error, the Astro team would appreciate if you could open an issue (https://astro.build/issues/) to alert them of the problem. This will help them identify and potentially fix the issue in future updates.

For more information, you can refer to the Astro documentation on this error (https://docs.astro.build/en/reference/errors/unknown-content-collection-error/).

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: