estruyf / slidev-theme-the-unnamed

Slidev Theme - The unnamed
https://www.npmjs.com/package/slidev-theme-the-unnamed
42 stars 5 forks source link

Themes works on first build of presentation, errors out afterwards #6

Closed jerdog closed 4 months ago

jerdog commented 4 months ago

Whenever creating a new slidev presentation, the default is seraph. When you add in the-unnamed it works, but all subsequent reloads / rebuilds of the presentation fail with:

node:internal/fs/read/utf8:20
  handleErrorFromBinding({ errno, syscall, path });
  ^

Error: ENOENT: no such file or directory, open '/Users/jerdog/dev/talks/test-pres-slidev/node_modules/slidev-theme-the-unnamed/setup/slidev-theme-the-unnamed/public/theme/theunnamed-dark-theme.json'
    at readFileSyncUtf8 (node:internal/fs/read/utf8:20:3)
    at Object.readFileSync (node:fs:467:12)
    at /Users/jerdog/dev/talkstest-pres-slidev/test-pres-slidev/node_modules/slidev-theme-the-unnamed/setup/shiki.ts:13:32
    at loadSetups (file:///Users/jerdog/dev/talks/test-pres-slidev/node_modules/@slidev/cli/dist/chunk-75T3CMVM.mjs:7738:28)
    at loadShikiSetups (file:///Users/jerdog/dev/talks/test-pres-slidev/node_modules/@slidev/cli/dist/chunk-75T3CMVM.mjs:7749:24)
    at createMarkdownItShiki (file:///Users/jerdog/dev/talks/test-pres-slidev/node_modules/@slidev/cli/dist/chunk-75T3CMVM.mjs:9389:5)
    at createMarkdownPlugin (file:///Users/jerdog/dev/talks/test-pres-slidev/node_modules/@slidev/cli/dist/chunk-75T3CMVM.mjs:9330:26)
    at ViteSlidevPlugin (file:///Users/jerdog/dev/talks/test-pres-slidev/node_modules/@slidev/cli/dist/chunk-75T3CMVM.mjs:9619:5)
    at async resolveViteConfigs (file:///Users/jerdog/dev/talks/test-pres-slidev/node_modules/@slidev/cli/dist/chunk-75T3CMVM.mjs:9764:7)
    at async createServer (file:///Users/jerdog/dev/talks/test-pres-slidev/node_modules/@slidev/cli/dist/chunk-Q2HOAG35.mjs:11:24)
    at async initServer (file:///Users/jerdog/dev/talks/test-pres-slidev/node_modules/@slidev/cli/dist/cli.mjs:130:16) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/Users/jerdog/dev/talks/test-pres-slidev/node_modules/slidev-theme-the-unnamed/setup/slidev-theme-the-unnamed/public/theme/theunnamed-dark-theme.json'
}

Node.js v20.5.0

I can change the theme back to seraph and it loads, and then change it to the-unnamed and it auto-reloads fine. But rebuilding with the-unnamed as the theme fails every time.

The error looks to be coming from: https://github.com/estruyf/slidev-theme-the-unnamed/blob/760305885e1d15bad34534fcfc8c228ea710dd1a/setup/shiki.ts#L8

as it's looking for the json file in /Users/jerdog/dev/talks/test-pres-slidev/node_modules/slidev-theme-the-unnamed/setup/slidev-theme-the-unnamed/public/theme/theunnamed-dark-theme.json where it isn't, instead of in /Users/jerdog/dev/talks/test-pres-slidev/node_modules/slidev-theme-the-unnamed/public/theme/theunnamed-dark-theme.json where it actually is.

All attempts to adjust the ".." to be indicative of the path where the file is don't seem to change where it's looking for the file. The ".." should actually work, but it's not changing the path at all - like it's ignoring it altogether.

MacOS: Sonoma 14.5 Node.js: v20.5.0 Slidev: 0.49.16

estruyf commented 4 months ago

I can reproduce it as well in the latest version. It has been working fine until the version 0.49.0. Let me see what I can do.

estruyf commented 4 months ago

I just released the fix in version 0.0.20. Thanks for opening the issue @jerdog.

jerdog commented 4 months ago

Confirm that it worked for me as well on the new version. Thanks for the responsiveness.


Jeremy Meiss

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." - Douglas Adams

LinkedIn https://www.linkedin.com/in/jeremymeiss / Website https://jmeiss.me / PGP Key https://keybase.io/jerdog/

On Wed, Jul 10, 2024 at 9:47 AM Elio Struyf @.***> wrote:

I just released the fix in version 0.0.20. Thanks for opening the issue @jerdog https://github.com/jerdog.

— Reply to this email directly, view it on GitHub https://github.com/estruyf/slidev-theme-the-unnamed/issues/6#issuecomment-2220715914, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACIPIE3AAPHWTVH4GLSR7LZLVCRFAVCNFSM6AAAAABKU5EH62VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRQG4YTKOJRGQ . You are receiving this because you were mentioned.Message ID: @.***>