storybook: Seeing an odd warning about a missing package.json (that isn't missing)
Describe the bug When building Storybook, I’m seeing a line in the output about a missing package.json for one of my dependencies. Normally I wouldn’t think that this was a Storybook issue, but I’m not seeing this warning from any other tool (including yarn and webpack). Also, the file totally exists, so I’m not sure what the problem is.
To Reproduce Steps to reproduce the behavior:
- Build Storybook
Expected behavior No warnings.
Screenshots

System
Environment Info:
System:
OS: Windows 10 10.0.19042
CPU: (4) x64 Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz
Binaries:
Node: 14.15.0 - C:\Program Files\Node.js\node.EXE
Yarn: 1.22.5 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.14.8 - C:\Program Files\Node.js\npm.CMD
Browsers:
Chrome: 86.0.4240.183
Edge: Spartan (44.19041.423.0), Chromium (86.0.622.63)
npmPackages:
@storybook/addon-actions: 6.1.0-beta.2 => 6.1.0-beta.2
@storybook/addon-knobs: 6.1.0-beta.2 => 6.1.0-beta.2
@storybook/addons: 6.1.0-beta.2 => 6.1.0-beta.2
@storybook/core: 6.1.0-beta.2 => 6.1.0-beta.2
@storybook/react: 6.1.0-beta.2 => 6.1.0-beta.2
@storybook/theming: 6.1.0-beta.2 => 6.1.0-beta.2
Additional context The file exists, so I don’t know why the warning is appearing:
$ file node_modules/simple-statistics/package.json
node_modules/simple-statistics/package.json: JSON data
$ cat node_modules/simple-statistics/package.json
{
"name": "simple-statistics",
"version": "7.3.2",
"description": "Simple Statistics",
"author": "Tom MacWright <tom@macwright.org> (http://macwright.org/)",
"repository": {
"type": "git",
"url": "git://github.com/simple-statistics/simple-statistics.git"
},
"files": [
"src",
"dist",
"index.js",
"index.d.ts"
],
"devDependencies": {
"@rollup/plugin-buble": "^0.21.1",
"cz-conventional-changelog": "^3.0.2",
"documentation": "^13",
"eslint": "^7.2.0",
"eslint-plugin-prettier": "^3.0.0",
"prettier": "^2.0.2",
"random-js": "^2.0.0",
"rollup": "^2.3.2",
"rollup-plugin-terser": "^7.0.1",
"standard-version": "^9.0.0",
"tap": "^14.4.1",
"typescript": "^4.0.2"
},
"scripts": {
"release": "standard-version && sh ./scripts/update_website.sh",
"test": "rollup -c rollup.config.js && npm run lint && tap --coverage test/*.test.js --jobs=4",
"build": "rollup -c rollup.config.js",
"prepublish": "rollup -c rollup.config.js && ./scripts/update_readme.js",
"prelint": "tsc --skipLibCheck",
"lint": "eslint index.js src test && prettier --check src/*.d.ts",
"postlint": "documentation lint src"
},
"source": "index.js",
"main": "dist/simple-statistics.js",
"module": "dist/simple-statistics.mjs",
"umd:main": "dist/simple-statistics.min.js",
"browser": "dist/simple-statistics.min.js",
"unpkg": "dist/simple-statistics.min.js",
"types": "index.d.ts",
"exports": {
"import": "./dist/simple-statistics.mjs",
"require": "./dist/simple-statistics.js"
},
"engines": {
"node": "*"
},
"license": "ISC",
"keywords": [
"descriptive",
"linear",
"math",
"probability",
"regression",
"statistics"
],
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
}
}
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 13
- Comments: 15 (5 by maintainers)
Tried to migrate nx storybook
looks like migration went well, but when I’m trying to run storybook - got an error:
Package subpath './dist/cjs/server/options' is not defined by "exports" in /Users/username/project/project-mono/node_modules/@storybook/react/package.jsonCrikey!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.3.0-alpha.19 containing PR #14785 that references this issue. Upgrade today to the
@nextNPM tag to try it out!Closing this issue. Please re-open if you think there’s still more to do.
Dug into this a little bit out of curiosity and found that it seems to be triggered by deps/devDeps that include an
exportsconfiguration in theirpackage.jsonthat does not explicitly export thepackage.jsonfile itself. Rollup’s config, as an example:And the error it generates (which is not currently displayed anywhere – this catch expression swallows the error text):
I’m not familiar enough with the config to say whether this is a misconfiguration on Rollup’s end or a correct configuration and thus a failure on the Storybook end to handle this particular case.
Having a similar issue to @Klypalskyi (only difference is that mine is failing at
manager-preset.js)Framework info:
Stacktrace
Same for me as for @clover-omelnyk @shilman Can you please take a look?
I’m trying to use it with:
"next": "12.2.2","preact": "10.7.3","preact-render-to-string": "5.2.0","react": "npm:@preact/compat@^17.1.1","react-dom": "npm:@preact/compat@^17.1.1"P.s.
6.5.9is throwing an error about:I propose we simply drop this warning: https://github.com/storybookjs/storybook/blob/32c63568d6f7f6ef90afd206405524543d5a7068/lib/core-server/src/manager/manager-config.ts#L37
Nothing will break if we do.