vitepress icon indicating copy to clipboard operation
vitepress copied to clipboard

Can't build when files are missing (ignoreDeadLinks is not working)

Open personalsoft-fabianobonin opened this issue 2 years ago • 4 comments
trafficstars

Describe the bug

Hi,

I'm currently working on a project where I'd like to proceed with building despite any dead links or missing resources. While I understand that it's best practice to have a documentation without these issues, I believe it's more important to generate a build even with potential inconsistencies.

I enabled the option ignoreDeadLinks: true but I am not able to build.

It complains about a productUnit.png file which is missing indeed, but I would like to build anyway.

How can I achieve this?

As a side note, I typically keep my assets such as images, spreadsheets, and PDFs in the same folder as my markdown files.

Regards,

Fabiano

⠼ building client + server bundles...Could not resolve "./productUnit.png" from "src/app/catalog/product/productUnit.md"
file: /opt/zen.erp.docs.engine/src/app/catalog/product/productUnit.md
✖ building client + server bundles...
build error:
RollupError: Could not resolve "./productUnit.png" from "src/app/catalog/product/productUnit.md"
    at error (file:///opt/zen.erp.docs.engine/node_modules/rollup/dist/es/shared/node-entry.js:2287:30)
    at ModuleLoader.handleInvalidResolvedId (file:///opt/zen.erp.docs.engine/node_modules/rollup/dist/es/shared/node-entry.js:24860:24)
    at file:///opt/zen.erp.docs.engine/node_modules/rollup/dist/es/shared/node-entry.js:24822:26

Reproduction

Could not reproduce in stackblitz:

https://stackblitz.com/edit/vite-vzvbjb?file=docs%2F.vitepress%2Fconfig.ts

Expected behavior

To build the docs

System Info

vitepress 1.0.0-rc.20

Additional context

No response

Validations

This isn't supported currently. ignoreDeadLinks is only for pages not assets.

brc-dd avatar Oct 12 '23 20:10 brc-dd

Do you have any insights into how StackBlitz is able to successfully build even when an asset is missing? If they've achieved this, there's likely a method I can implement as well.

The current behavior poses a significant obstacle for various scenarios. I manage a team responsible for generating documentation, and we have an automated build process triggered by a GitHub webhook. If any of my team members accidentally push a page with an invalid asset, it halts the entire documentation build process until someone manually inspects the logs.

Regards,

Fabiano

Do you have any insights into how StackBlitz is able to successfully build even when an asset is missing?

It doesn't. You probably are running the dev command.

image

brc-dd avatar Oct 13 '23 04:10 brc-dd

Was there ever a resolution to this? I'm importing an old poorly maintained wiki into VitePress, and some pages are unusable because of missing images or pdf links... the content is still good though.

I've updated all of the urls to technically they're coming from the 'public' folder, so I'd hoped it would skip the analysis. But it appears not.

If it dismiss the overlay, the site renders a 404.

kieronlanning avatar May 15 '25 15:05 kieronlanning