Open bhoov opened 3 weeks ago
Hi @bhoov! Have you also set the project type in _quarto.yml
?
project:
type: sverto
Once I set this, it worked with a new test project as described in your post.
(I should say that even before I did this, I didn't get the error you're reporting, I just had a 404 error for the compiled Svelte component.)
Interestingly, no. Adding the project "type: sverto" to _quarto.yml
did not fix my problem at all.
hoo@Hoo-M1 test-sverto-2 % quarto preview
Preparing to preview
_extensions/jimjam-slam/sverto/sverto-prerender.lua
> svelte-app@1.0.0 build
> rollup -c ./_extensions/jimjam-slam/sverto/rollup.config.js --configQuartoOutPath=/Users/hoo/Projects/test-sverto-2/_site --configSvelteInPaths=Circles.svelte:
Circles.svelte → _site...
created _site in 312ms
Sverto pre-render finished!
sverto-prerender.lua
Error running filter sverto-prerender.lua:
cannot open sverto-prerender.lua: No such file or directory
It's interesting that the pre-render is running once (note the "Sverto pre-render is finished" message) but not being found the second time 🤔
I have a small thing I'd like to show with this by the end of the week, so I'm invested in figuring this out. Any tips to debug?
FWIW, quarto render
has the same problem
I think if you can pop a quarto.log.info()
statement at the top of sverto-prerender.lua, it'd be great to triple-check that the pre-render script is indeed not running the second time!
Here's the output I get when I run these quarto preview
following those steps:
Preparing to preview
_extensions/jimjam-slam/sverto/sverto-prerender.lua
> svelte-app@1.0.0 build
> rollup -c ./_extensions/jimjam-slam/sverto/rollup.config.js --configQuartoOutPath=/Users/jgol0005/Code/tests/test-sverto-2/_site --configSvelteInPaths=
No Svelte filtes found; skipping Svelte compilation
Sverto pre-render finished!
Watching files for changes
Browse at http://localhost:3577/
GET: /
And then when navigating to example.html
:
Circles.svelte → _site...
created _site in 271ms
GET: /example.html
The second line might be the clue:
Preparing to preview
_extensions/jimjam-slam/sverto/sverto-prerender.lua
I wonder if your version of Quarto is incorrectly looking in the project directory for the filter, rather than stepping down to _extensions/jimjam-slam/sverto
to find it. Can you upgrade to the latest pre-release and try again? (I'm actually on 1.5.30, so if this fixes the problem, it will have been a temporary regression.)
This could be related to https://github.com/quarto-dev/quarto-cli/issues/9889, although I don't know why it didn't give me any trouble before...
Whelp. Downgrading from the latest pre-release (v1.5.43) to quarto v1.5.30 (in addition to changing the project.type: sverto
in _quarto.yml
) seems to allow sverto to be integrated into the website 🎉. Thanks for your help! Time for me to try porting my own visualizations and I will let you know if I have any issues.
In the meantime, perhaps it is worth documenting the necessity of changing the project.type
in _quarto.yml
? I'm not sure why the latest pre-release isn't working for me..
Okay, I can replicate your error on v1.5.43! I'll report it to the Quarto team... but I'm glad you're finding success on 1.5.30!
I must have had a brain fart — I thought I'd documented using the project type in the README. Maybe I only put it on the website?
Ideally, the project type and prerender script would be optional: it just takes the Svelte compilation off the filter's hands, so you don't end up compiling a component that is shared by several pages multiple times.
But at the moment, I think the filter decides whether to defer based on whether a project render is happening (regardless of type). So if you use a project but forget to set the type (or if it's a non-website project), you have a problem...
EDIT: yup, put it in the docs but not the README 🤦🏻♂️
Phew, i missed it. The README looks SO similar to the docs I thought it was the same page and skipped over the missing Step 4 🙈
Yeah, they should be structurally identical! Silly mistake on my part 😅
@bhoov https://github.com/quarto-dev/quarto-cli/pull/9953 should allow you to update once it's merged!
New prerelease v.1.5.44 seems to fix the problem for me!
I am having trouble integrating sverto into an existing Quarto project. I am encountering the following error:
To reproduce:
I see the same issue if I start from a newly initialized template and copy over quarto website project files (e.g., _quarto.yml, index.qmd, about.qmd, etc.).
Using quarto v1.5.42