Skip to content

Fix palette import path for OJS runtime#115

Merged
rdhyee merged 1 commit intoisamplesorg:mainfrom
rdhyee:fix/palette-import-path
Apr 16, 2026
Merged

Fix palette import path for OJS runtime#115
rdhyee merged 1 commit intoisamplesorg:mainfrom
rdhyee:fix/palette-import-path

Conversation

@rdhyee
Copy link
Copy Markdown
Contributor

@rdhyee rdhyee commented Apr 16, 2026

Follow-up to #114.

OJS resolves relative imports against its own runtime path (/site_libs/quarto-ojs/), not the page URL, so ../assets/js/source-palette.js was being fetched from https://isamples.org/site_libs/assets/js/source-palette.js (404) and breaking every OJS cell downstream.

Fix: compute an absolute URL from document.baseURI:

_palette = await import(new URL('/assets/js/source-palette.js', document.baseURI).href)

Verified with Playwright against a local render: module loads, SOURCE_COLORS exposed correctly.

Test plan

  • quarto render tutorials/progressive_globe.qmd succeeds
  • Playwright: dynamic import of /assets/js/source-palette.js returns the expected palette
  • Live site renders the globe (post-merge smoke test)

🤖 Generated with Claude Code

OJS resolves relative imports against its own runtime path
(/site_libs/quarto-ojs/), not the page URL — so ../assets/js/...
became /site_libs/assets/js/... (404). Use an absolute URL built
from document.baseURI so it resolves against the page instead.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@rdhyee rdhyee merged commit 6cde7f7 into isamplesorg:main Apr 16, 2026
1 check passed
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