nbnuk / nbn-project-hub

0 stars 3 forks source link

started getting errors starting storybook #14

Closed h-m-jones closed 1 year ago

h-m-jones commented 1 year ago

Problem

yarn storybook suddenly started throwing errors, some of which are listed below.

@storybook/cli v7.1.0

attention => Storybook now collects completely anonymous telemetry regarding usage.
This information is used to shape Storybook's roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://storybook.js.org/telemetry

info => Starting manager..
WARN No story files found for the specified pattern: src/**/*.mdx
✘ [ERROR] Could not resolve "@storybook/addon-controls/manager"

    ../../node_modules/@storybook/addon-essentials/dist/controls/manager.mjs:1:14:
      1 │ export * from '@storybook/addon-controls/manager';
        ╵               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  The Yarn Plug'n'Play manifest forbids importing "@storybook/addon-controls" here
  because it's not listed as a dependency of this package:

    ../../../../../.pnp.cjs:38:33:
      38 │           "packageDependencies": [\
         ╵                                  ~~

  You can mark the path "@storybook/addon-controls/manager" as external to exclude
  it from the bundle, which will remove this error.

✘ [ERROR] Could not resolve "@storybook/addon-backgrounds/manager"

    ../../node_modules/@storybook/addon-essentials/dist/backgrounds/manager.mjs:1:14:
      1 │ export * from '@storybook/addon-backgrounds/manager';
        ╵               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
h-m-jones commented 1 year ago

Solution

It looks like yarn has got into a state and its reverting to PnP

It issue was resolved by removing the contents in yarn.lock and rebuilding it by running yarn install again.