DEV Community

Manon
Manon

Posted on

1

Add storybook to your SvelteKit app

Pre-requisites:

  • have a SvelteKit project. You cannot install Storybook on an empty project.

Step 1: at your root project, run npx storybook init. During the installation, you will be asked if you want to run the 'eslintPlugin' migration on your project? Say yes. This is needed for the best Storybook experience.

Step 2: npm run storybook
You will probably get an [ERR_REQUIRE_ESM] error, something like this:

Image description

Fix:

  • in .storybook, rename your main.js file to main.cjs
  • in main.cjs file, replace this line "preprocess": require("../svelte.config.js").preprocess with preprocess: import('../svelte.config.js').preprocess.

Et voila! Enjoy 🙌

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read full post →

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more