Replies: 1 comment
-
To fix that I think you currently have to edit the downloaded notebook and replace: const fileAttachments = new Map([
["file.json", {url: new URL("./files/4a9f2e35c55bae819347fc76e92f5a3f121ae1cd7cf5d5a33c8bc41b4f3247fd16f8d438c3b99d6a19754638118c71673dc1deed2963b0b6f7d69a299bd23ded.json", import.meta.url), mimeType: "application/json", toString}]
]); by import {FileAttachment} from "observablehq:stdlib"; // at the top of the notebook file
...
const fileAttachments = new Map([["file.json", FileAttachment(
"./files/4a9f2e35c55bae819347fc76e92f5a3f121ae1cd7cf5d5a33c8bc41b4f3247fd16f8d438c3b99d6a19754638118c71673dc1deed2963b0b6f7d69a299bd23ded.json"
).href ]]); (I've tested with a json file but the story should be the same for csv.) Let us know how this goes. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to embed a downloaded version of an Observable notebook on a page of a Framework project like follows:
In principle this seems to work, with the only problem being that a file attached via
FileAttachment
can not be successfully loaded, causing all cells that depend on it to crash. I guess this is the same trouble as mentioned here. A proposed quick-fix proposed over there was to replace occurences ofwith
However, using require does not seem to be possible within a Framework project, where we set
"type": "module"
in thepackage.json
.I'm pretty new to javascript, so I apologize already in advance in case this is a trivial problem. I feel like I'm already super close to the solution I need, so any help is appreciated!
Beta Was this translation helpful? Give feedback.
All reactions