Similar to #16180 there is a problem with react@next a.k.a. (react@18.0.0-alpha-...), where the "exports" field was added to the package.json.
Storybook tries to resolve react/package.json in lib/ui, builder-webpack5 and builder-webpack4
node v12.22.7 is fine.
node v14.18.1 is fine.
node v16.13.0 succeed with a warning.
node16 --eval 'require.resolve("react/package.json")'
(node:624999) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at ...
node v17.0.1 throws an error.
node17 --eval 'require.resolve("react/package.json")'
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './package.json' is not defined by "exports" in ...
A possible solution for this specific react/package.json problem could be to just resolve the pkg name as in react instead of react/package.json.
node17 --eval 'require.resolve("react")'
// no error
Allthough this still might be broken should react choose to export a different subdirectory as its main entry.
Further context is available at nodejs/node#33460
Similar to #16180 there is a problem with
react@nexta.k.a. (react@18.0.0-alpha-...), where the"exports"field was added to thepackage.json.Storybook tries to resolve
react/package.jsonin lib/ui, builder-webpack5 and builder-webpack4node v12.22.7is fine.node v14.18.1is fine.node v16.13.0succeed with a warning.node v17.0.1throws an error.A possible solution for this specific
react/package.jsonproblem could be to just resolve the pkg name as inreactinstead ofreact/package.json.Allthough this still might be broken should
reactchoose to export a different subdirectory as its main entry.Further context is available at nodejs/node#33460