jimjam-slam / sverto

Add Svelte components to your Quarto documents
https://sverto.jamesgoldie.dev
MIT License
51 stars 3 forks source link

Example not working out of the box. `Error: Could not resolve entry module (rollup.config.js)` #23

Closed bhoov closed 3 weeks ago

bhoov commented 3 weeks ago

First off, I'm really excited to use this plugin to make an interactive, tutorial style website. It looks really neat! Unfortunately, I am unable to get the minimum example working out of the box.

To reproduce:

quarto use template jimjam-slam/sverto # Create new project `test-sverto`
cd test-sverto
npm install
quarto render example.qmd # ERROR

This last line produces the error [!] Error: Could not resolve entry module (rollup.config.js), full output below. I get the same error for quarto preview example.qmd and npm run build. I am new to the quarto ecosystem -- any tips?

hoo@hoo-M1 test-sverto % quarto render example.qmd 
pandoc 
  to: html
  output-file: example.html
  standalone: true
  section-divs: true
  html-math-method: mathjax
  wrap: none
  default-image-extension: png

metadata
  document-css: false
  link-citations: true
  date-format: long
  lang: en
  title: Sverto example
  date: last-modified
  sverto:
    use:
      - Circles.svelte

> svelte-app@1.0.0 build
> rollup -c rollup.config.js --configQuartoOutPath=./ --configSvelteInPaths=Circles.svelte:

[!] Error: Could not resolve entry module (rollup.config.js).
Error: Could not resolve entry module (rollup.config.js).
    at error (/Users/hoo/Projects/test-sverto/node_modules/rollup/dist/shared/rollup.js:198:30)
    at ModuleLoader.loadEntryModule (/Users/hoo/Projects/test-sverto/node_modules/rollup/dist/shared/rollup.js:22306:20)
    at async Promise.all (index 0)

Error running filter /Applications/quarto/share/filters/main.lua:
...ts/test-sverto/_extensions/jimjam-slam/sverto/sverto.lua:104: attempt to concatenate a nil value (local 'svelteResult')
stack traceback:
        [C]: in ?
        [C]: in method 'walk'
        /Applications/quarto/share/filters/main.lua:224: in local 'checked_walk'
        /Applications/quarto/share/filters/main.lua:276: in function 'run_emulated_filter'
        /Applications/quarto/share/filters/main.lua:942: in local 'callback'
        [string "..."]:1888: in field 'withScriptFile'
        /Applications/quarto/share/filters/main.lua:958: in upvalue 'run_emulated_filter_chain'
        /Applications/quarto/share/filters/main.lua:996: in function </Applications/quarto/share/filters/main.lua:993>
stack traceback:
        /Applications/quarto/share/filters/main.lua:224: in local 'checked_walk'
        /Applications/quarto/share/filters/main.lua:276: in function 'run_emulated_filter'
        /Applications/quarto/share/filters/main.lua:942: in local 'callback'
        [string "..."]:1888: in field 'withScriptFile'
        /Applications/quarto/share/filters/main.lua:958: in upvalue 'run_emulated_filter_chain'
        /Applications/quarto/share/filters/main.lua:996: in function </Applications/quarto/share/filters/main.lua:993>
bhoov commented 3 weeks ago

This error has been resolved by updating quarto from v1.4.555 to v1.5.42.

bhoov commented 3 weeks ago

Ok this bug is back after restarting my computer. Not sure why...

jimjam-slam commented 3 weeks ago

I've merged a fix in for this, @bhoov! Try re-running quarto use template ... so you can get the new version and let me know how you go 😊

bhoov commented 3 weeks ago

Incredible, you fixed this so quickly and the example works for me out of the box now. Thank you!!

bhoov commented 3 weeks ago

Unfortunately, I am still having issues integrating sverto into an existing quarto website. After running quarto use template jimjam-slam/sverto into an existing website and running quarto preview example.qmd, I get:

Error running filter sverto-prerender.lua:
cannot open sverto-prerender.lua: No such file or directory

I will open a new issue in the morning when I can make a minimally reproducible example. Ty!

jimjam-slam commented 3 weeks ago

That'd be great, @bhoov! I'll have more time to take a look later in the day, so if you can get a reprex going in the mean time, I'd be happy to take a look 😊 Apologies for the trouble you're having!

bhoov commented 3 weeks ago

If I can get it working it will have been worth all the trouble :)