Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Couldn't find story matching id 'undefined' after importing a CSF file. #245

Open
Shuraz opened this issue Feb 4, 2025 · 0 comments
Open

Comments

@Shuraz
Copy link

Shuraz commented Feb 4, 2025

I am trying to run storybook 8.5 on Svelte5 with webpack5. Able to load storybook on local, but not getting stories. It show: Couldn't find story matching id 'undefined' after importing a CSF file.

.storybook/main.js has

/** @type { import('@storybook/svelte-webpack5').StorybookConfig } /
const config = {
stories: ["../src/**/
.mdx", "../src/**/*.stories.@(js|ts|svelte)"],
addons: [
"@storybook/addon-svelte-csf",
"@storybook/addon-essentials",
"@chromatic-com/storybook",
"@storybook/addon-interactions",
],
framework: {
name: "@storybook/svelte-webpack5",
options: {},
},
core: {
builder: 'webpack5', // Ensure Webpack 5 is used
},
};
export default config;

[webpack.config.js has: ]

Image

const path = require('path');

module.exports = {
entry: './src/main.js',
output: {
path: path.resolve(__dirname, 'public'),
filename: 'bundle.js',
},
module: {
rules: [
{
test: /.svelte$/,
use: 'svelte-loader',
},
{
test: /.css$/,
use: ['style-loader', 'css-loader'],
},
{
test: /.(png|jpe?g|gif|svg)$/i,
use: 'file-loader',
},
{
test: /.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
},
}
],
},
resolve: {
extensions: ['.mjs', '.js', '.svelte'],
mainFields: ['svelte', 'browser', 'module', 'main'],
conditionNames: ['svelte', 'browser', 'import'],
},
devServer: {
static: {
directory: path.join(__dirname, 'public'),
},
compress: true,
port: 9001,
},
mode: 'development',
};

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

No branches or pull requests

1 participant