'Can't import component in Storybook

I have been trying to show my Component in storybook but when I am trying to import and render it , it shows this error in terminal.

ERROR in ./src/ui-kit/operator-panel/create-group/create-group-modal.tsx
Module not found: Error: Can't resolve 'src/lib/use-is-mobile' in 'C:\Users\Nikusha\Desktop\examo-react-storybook\src\ui-kit\operator-panel\create-group'
 @ ./src/ui-kit/operator-panel/create-group/create-group-modal.tsx 21:0-52 36:17-28
 @ ./src/stories/modal.stories.tsx
 @ ./src sync ^\.(?:(?:^|[\\/]|(?:(?:(?!(?:^|[\\/])\.).)*?)[\\/])(?!\.)(?=.)[^\\/]*?\.stories\.(js|jsx|ts|tsx))$
 @ ./generated-stories-entry.js
 @ multi ./node_modules/@storybook/core-client/dist/esm/globals/polyfills.js ./node_modules/@storybook/core-client/dist/esm/globals/globals.js (webpack)-hot-middleware/client.js?reload=true&quiet=false&noInfo=undefined ./storybook-init-framework-entry.js ./node_modules/@storybook/addon-docs/dist/esm/frameworks/common/config.js-generated-config-entry.js ./node_modules/@storybook/addon-docs/dist/esm/frameworks/react/config.js-generated-config-entry.js ./node_modules/@storybook/react/dist/esm/client/preview/config-generated-config-entry.js ./node_modules/@storybook/addon-links/dist/esm/preset/addDecorator.js-generated-config-entry.js ./node_modules/@storybook/addon-actions/dist/esm/preset/addDecorator.js-generated-config-entry.js ./node_modules/@storybook/addon-actions/dist/esm/preset/addArgs.js-generated-config-entry.js ./node_modules/@storybook/addon-backgrounds/dist/esm/preset/addDecorator.js-generated-config-entry.js ./node_modules/@storybook/addon-backgrounds/dist/esm/preset/addParameter.js-generated-config-entry.js ./node_modules/@storybook/addon-measure/dist/esm/preset/addDecorator.js-generated-config-entry.js ./node_modules/@storybook/addon-outline/dist/esm/preset/addDecorator.js-generated-config-entry.js ./node_modules/@storybook/addon-interactions/dist/esm/preset/argsEnhancers.js-generated-config-entry.js ./.storybook/preview.js-generated-config-entry.js ./generated-stories-entry.js

At the end of the terminal error says Error from chokidar (C:\): Error: EBUSY: resource busy or locked, lstat 'C:\DumpStack.log.tmp'

Here is the what I am doing in modal.stories.tsx

import { ComponentMeta, ComponentStory } from "@storybook/react"

import { CreateGroupModal } from "./../ui-kit/operator-panel/create-group/create-group-modal"

export default {
  title: "Modals/CreateGroupModal",
  component: CreateGroupModal,
} as ComponentMeta<typeof CreateGroupModal>

const Template: ComponentStory<typeof CreateGroupModal> = (args) => (
  <CreateGroupModal {...args} />
)

export const StoryCreateGroupModal = Template.bind({})
StoryCreateGroupModal.args = {}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source