Skip to content

slidev build returns 0 exit code despite failing (missing theme) #2122

Open
@c-harding

Description

@c-harding

Describe the bug

In my CI pipeline, I have the command pnpm slidev build.

If the theme is not installed, this leads to the following prompt:

? The theme "slidev-theme-xyz" was not found in your project, do you want to install it now? › (Y/n)

However, in CI, there is no stdin, so confirming is not possible. Instead, the process exits. The status code is 0 (success), meaning that the CI pipeline thinks the build was successful and continues.

Minimal reproduction

This is reproducible locally using npx slidev build < /dev/null.

Steps to reproduce the behavior:

  1. Check out any slidev project locally (https://sli.dev/new is not enough, because the shell does not support input redirection)
  2. Ensure slidev is installed, run npm install.
  3. Replace the theme with xyz.
  4. Run npx slidev build < /dev/null in bash.
  5. Check exit code (echo $?)
  6. See that it is zero, despite the build failing.

See example CI build: step Static HTML export with Slidev.

Environment

  • Slidev version: ^51.3.0
  • Browser: -
  • OS: macOS

If you are using Slidev globally (i.e. npx slidev or npm i -g slidev), please try to reproduce the issue in a local project (i.e. npm create slidev@latest).

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions