Skip to content

Prevent Error When Stencil Build Output Is Missing During Storybook Dev#5

Merged
christian-bromann merged 2 commits intostencil-community:mainfrom
timurzholudev:main
Jun 10, 2025
Merged

Prevent Error When Stencil Build Output Is Missing During Storybook Dev#5
christian-bromann merged 2 commits intostencil-community:mainfrom
timurzholudev:main

Conversation

@timurzholudev
Copy link
Copy Markdown
Contributor

Problem:

When running a clean installation of the project without generating a build using stencil build, the following error is thrown:

[vite] (client) Pre-transform error: Could not find the output file
  Plugin: unplugin-stencil
  File: /Users/git/unplugin-stencil/playground/components/my-component/my-component.tsx

[vite] Internal server error: Could not find the output file
  Plugin: unplugin-stencil

This error occurs because there are no build files present. The following code explicitly throws an error when the file is not found:

const exists = await compiler.sys.access(compilerFilePath)
      if (!exists)
        throw new Error('Could not find the output file')

Fix

Updated the logic to allow storybook dev to run even if the Stencil build output is missing. This ensures that developers can start Storybook in a clean state without requiring a prior stencil build.

Copy link
Copy Markdown
Member

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@christian-bromann christian-bromann merged commit 6af04b9 into stencil-community:main Jun 10, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants