Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two dev servers on the same port cause setup functions wrongly loaded #1830

Open
ChristopherWMM opened this issue Aug 20, 2024 · 2 comments
Open
Labels
bug Something isn't working has workaround

Comments

@ChristopherWMM
Copy link

ChristopherWMM commented Aug 20, 2024

Describe the bug

Sometimes, the initial run of the dev preview does not load custom code-runner implementations.

Minimal reproduction

Steps to reproduce the behavior:

  1. Execute npm run dev while having VSCode extension preview tab active
  2. Attempt to manually run / auto-run a non-standard monaco runner
  3. See Error: Runner for language "<lang>" not found on one of the presentations (in-editor or in-browser)

See slidev-code-runner for an example with a custom Python implementation in ./setup/code-runners.ts

Environment

  • Slidev version: v0.49.26 (using npm create slidev@latest)
  • Browser: Chrome
  • OS: Windows 10

Notes

This issue only occurs sometimes on the initial load of the dev preview, any subsequent loads after making edits to the project are fine. The built version of the project also appears to be fine.

@KermanX KermanX added the bug Something isn't working label Aug 21, 2024
@KermanX
Copy link
Member

KermanX commented Aug 21, 2024

Are there two Slidev servers running at the same time, and on the same port?

@ChristopherWMM
Copy link
Author

ChristopherWMM commented Aug 21, 2024

Are there two Slidev servers running at the same time, and on the same port?

Yes! Your question made me realize that I had the in-browser tab that pops up when starting the dev server AND the VSCode Slidev extension preview active at the same time. During my testing yesterday, I did not have the preview tab opened in VSCode and it worked fine. I just tried it again with the VSCode preview window open in my editor and one of the presentation instances (looks like the first one to load) encounters the Error: Runner for language "<lang>" not found error.

I edited the original issue post's replication instructions to reflect this new information.

@KermanX KermanX changed the title Custom code-runners don't always load on initial dev preview Two dev servers on the same port cause setup functions wrongly loaded Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working has workaround
Projects
None yet
Development

No branches or pull requests

2 participants