You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This isn’t a fixable problem in our current design: we can only promote assets that are declared statically, and anything within a hypertext literal is (by definition, since it’s inside JavaScript source rather than HTML) dynamic. You need to use FileAttachment if you want these assets to be treated as file attachments. I noted this previously in #424 (comment) and probably should be something we document.
(We could try to static analyze html tagged template literals of course, but my point is that you could always have JavaScript that is purely dynamic, so we’re never going to be able to find all the referenced files through static analysis. Therefore I suggest that we don’t try to static analyze beyond what we already do with FileAttachment.)
Local media assets should be promoted to file attachments in hypertext literals.
File structure:
In
test.md
:Error:
Running
yarn dev
and navigating tohttp://127.0.0.1:3000/test
shows a 404 when fetchinghttp://127.0.0.1:3000/sub/pic.jpg
.Expectation:
The fetch for
http://127.0.0.1:3000/sub/pic.jpg
should be rewritten ashttp://127.0.0.1:3000/_file/sub/pic.jpg
The text was updated successfully, but these errors were encountered: