Skip to content

Fix: Use absolute paths rather than relative ones to avoid invalid links after transformation - #19

Closed
ByteOtter wants to merge 1 commit into
mainfrom
fix/fix-broken-asset-links
Closed

ByteOtter wants to merge 1 commit into
mainfrom
fix/fix-broken-asset-links

Conversation

@ByteOtter

Copy link
Copy Markdown
Collaborator

What this PR does / why we need it:

Changes the way asset/media links are handled. Instead of using relative paths, we try to parse into absolute ones to avoid build failures like this one: https://app.netlify.com/projects/gardenlinux-docs/deploys/69ca6c7386e6990008640519

2:28:49 PM: pnpm run docs:build
2:28:49 PM: > @ docs:build /opt/build/repo
2:28:49 PM: > vitepress build docs
2:28:49 PM:   vitepress v1.6.3
2:28:49 PM: - building client + server bundles...
2:28:51 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
2:28:51 PM: x Build failed in 958ms
2:28:51 PM: ✖ building client + server bundles...
2:28:51 PM: build error:
2:28:51 PM: Could not resolve "./../assets/first-boot-aws-image.png" from "docs/tutorials/cloud/first-boot-aws.md"
2:28:51 PM: file: /opt/build/repo/docs/tutorials/cloud/first-boot-aws.md
2:28:51 PM: Could not resolve "./../assets/first-boot-aws-image.png" from "docs/tutorials/cloud/first-boot-aws.md"
2:28:51 PM: file: /opt/build/repo/docs/tutorials/cloud/first-boot-aws.md
2:28:51 PM:     at getRollupError (file:///opt/build/repo/node_modules/.pnpm/rollup@4.59.0/node_modules/rollup/dist/es/shared/parseAst.js:402:41)
2:28:51 PM:     at error (file:///opt/build/repo/node_modules/.pnpm/rollup@4.59.0/node_modules/rollup/dist/es/shared/parseAst.js:398:42)
2:28:51 PM:     at ModuleLoader.handleInvalidResolvedId (file:///opt/build/repo/node_modules/.pnpm/rollup@4.59.0/node_modules/rollup/dist/es/shared/node-entry.js:21710:24)
2:28:51 PM:     at file:///opt/build/repo/node_modules/.pnpm/rollup@4.59.0/node_modules/rollup/dist/es/shared/node-entry.js:21670:26
2:28:51 PM:  ELIFECYCLE  Command failed with exit code 1. (https://ntl.fyi/exit-code-1)
2:28:51 PM: make: *** [Makefile:39: build] Error 1
2:28:51 PM: ​
2:28:51 PM: "build.command" failed                                        
2:28:51 PM: ────────────────────────────────────────────────────────────────
2:28:51 PM: ​
2:28:51 PM:   Error message
2:28:51 PM:   Command failed with exit code 2: make build (https://ntl.fyi/exit-code-2)
2:28:51 PM: ​
2:28:51 PM:   Error location
2:28:51 PM:   In Build command from Netlify app:
2:28:51 PM:   make build
2:28:51 PM: ​
2:28:51 PM:   Resolved config
2:28:51 PM:   build:
2:28:51 PM:     command: make build
2:28:51 PM:     commandOrigin: ui
2:28:51 PM:     environment:
2:28:51 PM:       - REVIEW_ID
2:28:51 PM:     publish: /opt/build/repo/docs/.vitepress/dist
2:28:51 PM:     publishOrigin: ui
2:28:51 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
2:28:51 PM: Failing build: Failed to build site
2:28:51 PM: Finished processing build request in 15.323s

Which issue(s) this PR fixes:
Fixes ##18

Definition of Done:

  • The code is sufficiently documented
  • Shared the changes with the Team so everyone is aware
  • The code is appropriately tested
  • Checked if the code needs to be backportet to release branches of maintained versions (perform the actual backport after the merge to main)

Special notes for your reviewer:

Release note:

@netlify

netlify Bot commented Mar 30, 2026

Copy link
Copy Markdown

Deploy Preview for gardenlinux-docs failed.

Name Link
🔨 Latest commit d16f675
🔍 Latest deploy log https://app.netlify.com/projects/gardenlinux-docs/deploys/69ca70c750db81000881f0b1

@ByteOtter

Copy link
Copy Markdown
Collaborator Author

Just found out it's a problem with the source .. not the transformation...

@ByteOtter ByteOtter closed this Mar 30, 2026
@ByteOtter
ByteOtter deleted the fix/fix-broken-asset-links branch March 30, 2026 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant