Skip to content

[React 19] Unable to get stories. Try adding import 'loki/configure-react' to your .storybook/preview.js file. #549

Description

@LLEGIT

I'm currently blocked in the setup phase of Loki, my Storybook is running without errors and I added to my preview.ts file the line import 'loki/configure-react' to attempt fixing the error :
Unable to get stories. Try adding import 'loki/configure-react' to your .storybook/preview.js file.

I don't have dependencies in the project, only devDependencies.

  "devDependencies": {
    "@chromatic-com/storybook": "4.1.1",
    "@storybook/addon-a11y": "9.1.3",
    "@storybook/addon-designs": "10.0.2",
    "@storybook/addon-docs": "9.1.3",
    "@storybook/addon-links": "9.1.3",
    "@storybook/addon-onboarding": "9.1.3",
    "@storybook/react": "9.1.3",
    "@storybook/react-vite": "9.1.3",
    "loki": "0.35.1",
    "react": "19.1.1",
    "react-dom": "19.1.1",
    "storybook": "9.1.3",
    "storybook-design-token": "4.1.0"
  }

Here is my loki.config.js file

module.exports = {
  chromeSelector: '#my-decorator > *',
  configurations: {
    'chrome.laptop': {
      target: 'chrome.app',
      width: 1366,
      height: 768,
    },
    'chrome.iphone7': {
      target: 'chrome.docker',
      preset: 'iPhone 7',
    },
    'chrome.a4': {
      target: 'chrome.aws-lambda',
      preset: 'A4 Paper',
    },
    ios: {
      target: 'ios.simulator',
    },
    android: {
      target: 'android.emulator',
    },
  },
};

My .storybook folder consists of these files :

  • main.ts
  • manager.ts
  • preview-body.html
  • preview-head.html
  • preview.ts

I already tried converting .ts files in pure javascript but it doesn't change the outcome. Did someone encounter the same problem on his/her project ?

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions