Skip to content
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

What does the warning WARN unable to find package.json for rollup means? #14000

Closed
rhuanbarreto opened this issue Feb 22, 2021 · 9 comments
Closed

Comments

@rhuanbarreto
Copy link

Describe the bug
I receive the warning in the console every time i start a storybook for a library I'm creating:

WARN unable to find package.json for rollup

My dependencies in package.json:

"devDependencies": {
    "@babel/core": "^7.12.13",
    "@babel/preset-react": "^7.12.13",
    "@rollup/plugin-babel": "^5.2.3",
    "@rollup/plugin-json": "^4.1.0",
    "@storybook/addon-actions": "^6.1.17",
    "@storybook/addon-essentials": "^6.1.17",
    "@storybook/addon-links": "^6.1.17",
    "@storybook/react": "^6.1.17",
    "@typescript-eslint/eslint-plugin": "^4.15.1",
    "@typescript-eslint/parser": "^4.15.1",
    "babel-eslint": "^10.1.0",
    "babel-loader": "^8.2.2",
    "eslint": "^7.20.0",
    "eslint-config-react-app": "^6.0.0",
    "eslint-plugin-flowtype": "^5.2.0",
    "eslint-plugin-import": "^2.22.1",
    "eslint-plugin-jsx-a11y": "^6.4.1",
    "eslint-plugin-react": "^7.22.0",
    "eslint-plugin-react-hooks": "^4.2.0",
    "rollup": "^2.38.5",
    "rollup-plugin-commonjs": "^10.1.0",
    "rollup-plugin-delete": "^2.0.0",
    "rollup-plugin-generate-package-json": "^3.2.0",
    "rollup-plugin-node-resolve": "^5.2.0",
    "rollup-plugin-peer-deps-external": "^2.2.3"
  },
  "peerDependencies": {
    "lodash.filter": "^4.6.0",
    "lodash.orderby": "^4.6.0",
    "lodash.pickby": "^4.6.0",
    "prop-types": "^15.7.2",
    "react": "^17.0.1",
    "react-dom": "^17.0.1"
  }
@ckaethler
Copy link

^ Having the same error and would love some suggested solutions

@shilman
Copy link
Member

shilman commented Mar 5, 2021

Do you have a repro repo you can share?

@tihuan
Copy link

tihuan commented Mar 6, 2021

I have the same issue!

Please try: https://github.com/tihuan/components and run yarn && yarn storybook 🙏

Thank you!

@sagic
Copy link

sagic commented Mar 8, 2021

same here 🙋🏻‍♂️

@shilman
Copy link
Member

shilman commented Mar 8, 2021

This warning is being printed here: https://github.com/storybookjs/storybook/blob/next/lib/core-server/src/manager/manager-config.ts#L37

Storybook is going through your project's dependencies and trying to read the package.json to extract the storybook metadata from it in the case of component libraries with published storybook's. I don't know why this code can't find rollup's package.json, but the warning can safely be ignored because rollup is not a component library and does not have said metadata.

@tihuan
Copy link

tihuan commented Mar 8, 2021

Ahh perfect! Thanks so much, @shilman 🤩 Can confirm that the components work as intended in the storybook even with the warning 👍 Have a wonderful day!

@shilman shilman closed this as completed Mar 8, 2021
@zanona
Copy link

zanona commented Mar 27, 2021

related #13099

lmestel added a commit to kickstartDS/kickstartDS that referenced this issue Apr 30, 2021
the storybook warning "unable to find package.json for yargs-parser"
can be ignored.
(storybookjs/storybook#14000 (comment))
@lotyp
Copy link

lotyp commented Feb 24, 2023

Problem still exists:

WARN unable to find package.json for @wayofdev/ui

when I'm running build in my monorepo:

turbo run build --filter=storybook --color --parallel

## or
pnpm --filter=storybook build:storybook

Repo is located here:

https://github.com/wayofdev/next-starter-tpl

Project structure:

.
├── apps
│   ├── docs
│   │   └── package.json
│   ├── storybook
│   │   └── package.json
│   └── web
│       └── package.json
├── packages
│   ├── common-i18n
│   │   └── package.json
│   ├── facebook-pixel
│   │   └── package.json
│   ├── google-tag-manager
│   │   └── package.json
│   └── ui
│       └── package.json
└── package.json

@rexkenley
Copy link

rexkenley commented Jun 20, 2023

@shilman, maybe related but I am getting

Executing task: npx nx run catalog:storybook 
> nx run catalog:storybook
info => Starting manager..
WARN unable to find package.json for @storybook/react-vite
WARN unable to find package.json for vite

And I don't use vite. The only instance of @storybook/react-vite is in the root package.json

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

No branches or pull requests

8 participants