Skip to content

Conversation

timurzholudev
Copy link
Contributor

Description

After generating a new Stencil project with Storybook and required plugins, the Stencil build fails due to a recursive type reference in the generated JSX.IntrinsicElements and JSX.Element interfaces.

Error

Type 'IntrinsicElements' recursively references itself as a base type

This occurs once Stencil’s generated types are flattened by the compiler

Workaround

Temporarily set "skipLibCheck": true in tsconfig.json to bypass .d.ts type-checking and allow the build to proceed.

⚠️ Note: Some organizations or repos may restrict the use of skipLibCheck, so this should be considered a temporary workaround.

Fix

Consider capturing a snapshot of Stencil’s generated interfaces and extending from aliases instead of live JSX types to avoid the self-referencing issue.

How to reproduce

  1. In packages/example/tsconfig.json, remove "skipLibCheck": true
  2. Run stencil build

Copy link
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 efe0295 into stenciljs:main May 29, 2025
1 check 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