[Bug] Can't see any stories files
See original GitHub issueWhat version of vite
are you using?
“vite”: “^3.0.0”
System info and storybook versions
“devDependencies”: { “@babel/core”: “^7.18.9”, “@joshwooding/vite-plugin-react-docgen-typescript”: “^0.0.5”, “@rollup/plugin-alias”: “^3.1.9”, “@storybook/addon-actions”: “^6.5.9”, “@storybook/addon-backgrounds”: “^6.5.9”, “@storybook/addon-docs”: “^6.5.9”, “@storybook/addon-essentials”: “^6.5.9”, “@storybook/addon-interactions”: “^6.5.9”, “@storybook/addon-links”: “^6.5.9”, “@storybook/addon-measure”: “^6.5.9”, “@storybook/addon-outline”: “^6.5.9”, “@storybook/addons”: “^6.5.9”, “@storybook/builder-vite”: “^0.2.0”, “@storybook/channel-postmessage”: “^6.5.9”, “@storybook/channel-websocket”: “^6.5.9”, “@storybook/client-api”: “^6.5.9”, “@storybook/client-logger”: “^6.5.9”, “@storybook/preview-web”: “^6.5.9”, “@storybook/react”: “^6.5.9”, “@storybook/testing-library”: “^0.0.13”, “@types/react”: “^18.0.15”, “@types/react-dom”: “^18.0.6”, “@typescript-eslint/parser”: “^5.30.7”, “@vitejs/plugin-react”: “^2.0.0”, “autoprefixer”: “^10.4.7”, “babel-loader”: “^8.2.5”, “eslint”: “^8.20.0”, “eslint-config-airbnb”: “^19.0.4”, “eslint-config-airbnb-typescript-prettier”: “^5.0.0”, “eslint-config-prettier”: “^8.5.0”, “eslint-plugin-import”: “^2.25.3”, “eslint-plugin-jsx-a11y”: “^6.5.1”, “eslint-plugin-prettier”: “^4.2.1”, “eslint-plugin-react”: “^7.28.0”, “eslint-plugin-react-hooks”: “^4.3.0”, “patch-package”: “^6.4.7”, “postcss”: “^8.4.14”, “postcss-load-config”: “^4.0.1”, “prettier”: “^2.7.1”, “tailwindcss”: “^3.1.6”, “tsconfig-paths-webpack-plugin”: “^3.5.2”, “typescript”: “^4.7.4”, “vite”: “^3.0.0” }
Describe the Bug
Hello , i’m trying create starter vite-react-ts-eslint-storybook for test i create small component bButton, and stories Button.stories.ts here my files :
./storybook/main.js
module.exports = {
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
'@storybook/addon-docs'
],
framework: '@storybook/react',
core: {
builder: '@storybook/builder-vite'
},
features: {
storyStoreV7: true
},
}
vite.config.ts
import { defineConfig, loadEnv } from 'vite'
import react from '@vitejs/plugin-react'
import { resolve } from 'path'
import tsconfigPaths from 'vite-tsconfig-paths'
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, `${__dirname}/vars`, '')
return {
envDir: `./vars`,
envPrefix: 'ENV',
plugins: [react(), tsconfigPaths()],
base: '',
server: {
port: env.DEV_PORT
},
}
})
tsconfig.json
{
"compilerOptions": {
"target": "ESNext",
"useDefineForClassFields": true,
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"allowJs": true,
"skipLibCheck": false,
"esModuleInterop": false,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "ESNext",
"moduleResolution": "Node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
}
},
"include": ["./src"]
}
.babelrc
{
"presets": ["@babel/preset-env", "@babel/preset-typescript"]
}
Button.stories.tsx
import React from 'react'
import { ComponentStory, ComponentMeta } from '@storybook/react'
import { Button } from './button'
export default {
/* 👇 The title prop is optional.
* See https://storybook.js.org/docs/react/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'Button',
component: Button
} as ComponentMeta<typeof Button>
export const Primary: ComponentStory<typeof Button> = (args) => <Button {...args} />
maybe i do something wrong with alias or paths?
Link to Minimal Reproducible Example
No response
Participation
- I am willing to submit a pull request for this issue.
Issue Analytics
- State:
- Created a year ago
- Comments:7 (4 by maintainers)
IanVS here : https://github.com/Drew11/full-stack-react-nest
I’m not sure why it wasn’t working, but glad you’re in good shape now.