Skip to content
This repository was archived by the owner on Nov 6, 2024. It is now read-only.
This repository was archived by the owner on Nov 6, 2024. It is now read-only.

[BUG] Error starting Storybook - images/icons directory is incorrect #105

@codechefmarc

Description

@codechefmarc

Describe the bug
When starting Storybook for the first time after a clean install of Emulsify and Compound (default components), Storybook will not start and instead return an error:

ERROR in ./components/01-atoms/images/images.stories.js 1:1762-1815
Module not found: Error: Can't resolve '../../../images/icons/' in 'components/01-atoms/images'
 @ ./components/ lazy ^\.\/.*$ include: (?:\/components(?:\/(?%21\.)(?:(?:(?%21(?:^%7C\/)\.).)*?)\/%7C\/%7C$)(?%21\.)(?=.)[^/]*?\.stories\.(js%7Cjsx%7Cts%7Ctsx))$ chunkName: [request] namespace object ./01-atoms/images/images.stories.js ./01-atoms/images/images.stories
 @ ./storybook-stories.js 23:11-27:5

The error seems to be related to line 8 in components/01-atoms/images/images.stories.js:

const svgIcons = require.context('../../../images/icons/', true, /\.svg$/);

Which points to a non-existent images directory in the root of the theme. Instead, this should point to the assets/icons directory that does exist in the root of the theme.

To Reproduce
Steps to reproduce the behavior:

  1. Install Emulsify as per https://www.emulsify.info/docs/emulsify-drupal
  2. Go into the newly created theme directory and run emulsify system install compound
  3. Run npm install
  4. Then, run npm run storybook
  5. See error that is shown above.

Expected behavior
Storybook should run without errors.

Desktop (please complete the following information):

  • OS: macOS 14.1.2
  • Browser: N/A

Metadata

Metadata

Labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions