storybook: Dev server breaks with Node 18.0.0 + node-ip 1.1.5
Describe the bug When updating to Node 18.0.0 start-storybook breaks with
TypeError: details.family.toLowerCase is not a function
at .../node_modules/ip/lib/ip.js:385:39
at .../node_modules/ip/lib/ip.js:384:37
at .../node_modules/ip/lib/ip.js:379:37
at .../node_modules/@storybook/core-server/dist/cjs/utils/server-address.js:20:55
To Reproduce
Launch a start-storybook with Node 18.0.0 and node-ip@1.1.5.
System
System: OS: Windows 10 10.0.19044 CPU: (24) x64 12th Gen Intel® Core™ i9-12900KF Binaries: Node: 16.14.2 - C:\Program Files\nodejs\node.EXE npm: 8.6.0 - C:\Program Files\nodejs\npm.CMD Browsers: Edge: Spartan (44.19041.1266.0), Chromium (100.0.1185.44) npmPackages: @storybook/addon-a11y: ^6.4.22 => 6.4.22 @storybook/addon-docs: ^6.4.18 => 6.4.22 @storybook/addon-essentials: ^6.4.22 => 6.4.22 @storybook/addons: ^6.4.18 => 6.4.22 @storybook/builder-webpack5: ^6.4.18 => 6.4.22 @storybook/manager-webpack5: ^6.4.18 => 6.4.22 @storybook/theming: ^6.4.18 => 6.4.22 @storybook/vue3: ^6.4.18 => 6.4.22
Additional context This is caused by the following Node 18 introduced Undocumented change to “family” attribute in os.networkInterfaces() in Node 18. Issue on node-ip along with a PR has been submitted.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 23
- Comments: 16 (4 by maintainers)
Commits related to this issue
- SX Design: patch 3rd party dependency See: https://github.com/storybookjs/storybook/issues/18019 Should we resolved in `ip` version 1.1.6 or 2.0.0, see: https://github.com/indutny/node-ip/commit/4de... — committed to adeira/universe by mrtnzlml 2 years ago
- SX Design: patch 3rd party dependency See: https://github.com/storybookjs/storybook/issues/18019 Should we resolved in `ip` version 1.1.6 or 2.0.0, see: https://github.com/indutny/node-ip/commit/4de... — committed to adeira/universe by mrtnzlml 2 years ago
- SX Design: patch 3rd party dependency See: https://github.com/storybookjs/storybook/issues/18019 Should we resolved in `ip` version 1.1.6 or 2.0.0, see: https://github.com/indutny/node-ip/commit/4de... — committed to adeira/sx-design by mrtnzlml 2 years ago
- update storybook packjson specify host --host 0.0.0.0 https://github.com/storybookjs/storybook/issues/18019 — committed to 2p4b/octal-clients by 2p4b 2 years ago
Found a workaround.
The error only comes if Storybook attempts to figure out the current network address If the host option is set then the problem is avoided.
So passing
-h localhostto start-storybook bypasses the problem.Thank you so much! That solved it for me.
I’m facing the same issue. Specifying
--host localhostoption caused a different error on my env.My environment
.storybook/main.js
Runned command
Result
I’m running Storybook in Docker. The
localhostworkaround doesn’t work for me. I can’t connect to the server from my browser, even if the original error is muted. After digging around in the code, I could tell that--hostis used for a few things. Apart for displaying a welcome message and opening Storybook in the browser, it’s also passed to Express’slisten().With the information above, I got it to work with the unspecific IPv4 address 0.0.0.0, i.e. by passing
--host 0.0.0.0tostart-storybook.As a workaround, what helped me to make storybook work with node 18, is install these addons and webpack
main.js
Meanwhile, node-ip@1.1.6 and node-ip2.0.0 have been released already including the fix. Fixing this issue should be a version bump now. (Fingers crossed.)
export NODE_OPTIONS=–openssl-legacy-provider
solved the issue for me
https://stackoverflow.com/questions/69692842/error-message-error0308010cdigital-envelope-routinesunsupported
Edit: actually my issue is tracked at https://github.com/storybookjs/storybook/issues/16555
I seem to have this issue with following dependencies:
I can’t run
sb upgradeyet (we use 2 separate package.json to isolate the dependencies of Storybook from the code), is there something else to do to avoid this issue?“ip” is on 1.1.8 as expected
I am on 6.5.12 and it seemed to have been fixed in 6.5.6 already.
I am using Node 18.12.0.
The error message is specifically the one from @arayaryoma above, related to “crypto”: https://github.com/storybookjs/storybook/issues/18019#issuecomment-1121953310
Good golly!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.5.6 containing PR #18330 that references this issue. Upgrade today to the
@latestNPM tag to try it out!Great Caesar’s ghost!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.5.6-alpha.0 containing PR #18330 that references this issue. Upgrade today to the
@prereleaseNPM tag to try it out!Closing this issue. Please re-open if you think there’s still more to do.
@bonesoul This is fixed in
node-ip@1.1.6, so it should be enough to upgrade your dependencies. I chose to enforce a package resolution using Yarn and leave all other packages as they were. YMMV.@arayaryoma Please see https://github.com/storybookjs/storybook/issues/16555 for this issue.