question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] Can't see any stories files

See original GitHub issue

What 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} />

image

image

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:closed
  • Created a year ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ghostcommented, Jul 24, 2022
0reactions
IanVScommented, Jul 25, 2022

I’m not sure why it wasn’t working, but glad you’re in good shape now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Fix Archived Stories Missing Or Not Working On ...
Let's fix your Instagram app if any of your archived stories are missing or not working so you can't reinstate the stories or...
Read more >
Instagram Stories won't load: 13 issues and how to fix them!
One of the most common issues when our Instagram Stories won't load is some ... When you open it up, tap the See...
Read more >
"Couldn't find any stories in your Storybook." after upgrade to ...
Describe the bug This worked before, but now complains it cannot find any stories anymore: { stories: [ // stories folder: ignore ...
Read more >
Fix Instagram Story Views Not Showing Issues - FlexClip
Your Instagram Story views not showing? Follow the steps below to fix tedious Instagram story views not showing issues. Let's get started!
Read more >
Instagram Stories Not Loading? A Troubleshooting Guide
The first thing you should do if your Instagram Stories are not loading is to check your internet connection. If you're on a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found