Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

StorybookJS not importing RequireJS components properly #14211

Closed
salehkaddoura-alation opened this issue Mar 11, 2021 · 0 comments
Closed

StorybookJS not importing RequireJS components properly #14211

salehkaddoura-alation opened this issue Mar 11, 2021 · 0 comments

Comments

@salehkaddoura-alation
Copy link

salehkaddoura-alation commented Mar 11, 2021

Hello storybook team, this is not necessarily a bug but an issue I ran into and would like some guidance.

I am creating my first story and attempting to import one of my components and I am running into this error.

ERROR in ./js/require/****/views/uikit/UIButton.jsx Module not found: Error: Can't resolve 'alation/views/uikit/UITooltip' in '/Users/saleh.kaddoura/dev/alation/django/static/js/require/****/views/uikit'

All of my components are in this path js/require/****/views/uikit/***.jsx

the imports for uikit/UIButton.jsx look like this:

define(function(require) {
  var PropTypes = require('prop-types');
  var React = require('react');
  var createReactClass = require('create-react-class');
  var UITooltip = require('jsx!alation/views/uikit/UITooltip');

storybook stories is located here js/stories/UIButton/UIButton.jsx this file is as follows:

import React from 'react';

import { UIButton } from '../../js/require/alation/views/uikit/UIButton';

How do I get storybook to look for components in the correct path?

Should I move the stories directory somewhere else?

Can I add some configuration to storybook to tell where to look for nested imports?

@shilman shilman closed this as completed Mar 12, 2021
@storybookjs storybookjs locked and limited conversation to collaborators Mar 12, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants