Skip to content

Conversation

timurzholudev
Copy link
Contributor

Summary

This PR resolves two issues encountered when integrating @stencil/storybook-plugin:

  • SB_CORE-SERVER_0002: Storybook failed to load the preset due to __dirname usage in an ES module context.
  • ERR_MODULE_NOT_FOUND: Module resolution failed for component-to-jsx in render.js due to missing .js extension in import paths.

Changes Made

  • Replaced __dirname with import.meta.url and fileURLToPath() in preset.js to ensure compatibility with ESM.
  • Updated import statements to include .js extensions

Testing

  • Verified that the Plugin builds without errors.
  • Verified that Storybook starts without errors using npm run storybook.
  • Confirmed that all components render successfully in the Storybook UI.
  • Ensured no broken imports or runtime resolution issues occur.​
  • Ensured tests are passing.

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.

Minor nit, otherwise LGTM 👍

@christian-bromann christian-bromann merged commit bfb53ad into stenciljs:main May 12, 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