Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using a /data/ path in sql front-matter is broken #1796

Closed
Fil opened this issue Nov 4, 2024 · 0 comments · Fixed by #1797
Closed

Using a /data/ path in sql front-matter is broken #1796

Fil opened this issue Nov 4, 2024 · 0 comments · Fixed by #1797
Labels
bug Something isn’t working

Comments

@Fil
Copy link
Contributor

Fil commented Nov 4, 2024

If I use

---
sql:
  penguins: /data/penguins.csv
---

the path is constructed from the site root, and this fails when the site is hosted at a non-root URL.

Case in point: https://observablehq.observablehq.cloud/pangea/duckdb/pivot-table was erroring with

stdlib.51b9da18.js:1 Uncaught Error: File not found: ../data/penguins.csv
    at FileAttachment (stdlib.51b9da18.js:1:655)
    at pivot-table:36:27

I can fix my page by changing the front-matter to

---
sql:
  penguins: ../data/penguins.csv
---
@Fil Fil added the bug Something isn’t working label Nov 4, 2024
@Fil Fil closed this as completed in #1797 Nov 6, 2024
@Fil Fil closed this as completed in fb6566c Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn’t working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant