question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Upgrading @storybook/addon-actions from 5.2.8 to 5.3.2 breaks fetch?

See original GitHub issue

Describe the bug I upgraded @storybook/addon-actions, and after upgrade, my universal app was having issues calling fetch from node.

TypeError: realFetch.call is not a function
    at module.exports (webpack-internal:///./node_modules/isomorphic-fetch/fetch-npm-node.js:8:19)
    at AjaxActions.callApi (webpack-internal:///../shared/src/js/utils/AjaxActions.ts:802:46)
    at dispatch (webpack-internal:///../shared/src/js/utils/AjaxActions.ts:656:21)
    at Object.action [as dispatch] (webpack-internal:///../shared/src/js/middleware/TockApiMiddleware.ts:209:13)
    at fetchServerData (webpack-internal:///./src/server/routing.ts:75:38)
    at serverRender (webpack-internal:///./src/server/app.tsx:575:48)
    at app.use (/Users/kelly/tock/admin/consumer/src/server/dev.js:72:14)
    at Layer.handle [as handle_request] (/Users/kelly/tock/admin/consumer/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/Users/kelly/tock/admin/consumer/node_modules/express/lib/router/index.js:317:13)
    at /Users/kelly/tock/admin/consumer/node_modules/express/lib/router/index.js:284:7
Trace: TypeError: Cannot read property 'catch' of undefined
    at fetchServerData (webpack-internal:///./src/server/routing.ts:75:100)
    at serverRender (webpack-internal:///./src/server/app.tsx:575:48)
    at app.use (/Users/kelly/tock/admin/consumer/src/server/dev.js:72:14)
    at Layer.handle [as handle_request] (/Users/kelly/tock/admin/consumer/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/Users/kelly/tock/admin/consumer/node_modules/express/lib/router/index.js:317:13)
    at /Users/kelly/tock/admin/consumer/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/Users/kelly/tock/admin/consumer/node_modules/express/lib/router/index.js:335:12)
    at next (/Users/kelly/tock/admin/consumer/node_modules/express/lib/router/index.js:275:10)
    at logger (/Users/kelly/tock/admin/consumer/node_modules/morgan/index.js:144:5)
    at Layer.handle [as handle_request] (/Users/kelly/tock/admin/consumer/node_modules/express/lib/router/layer.js:95:5)
127.0.0.1 - - [14/Jan/2020:00:08:56 +0000] "GET /city/chicago?size=2&time=17:00&date=2020-01-15 HTTP/1.1" 500 2 1532.261

I have isomorhpic fetch@2.2.1, node v11.12.0.

To Reproduce Steps to reproduce the behavior: This is specific to my project, and not to storybook directly. you would have to have my app installed.

Expected behavior I expect fetch to still work.

Screenshots If applicable, add screenshots to help explain your problem.

Code snippets If applicable, add code samples to help explain your problem.

System: Please paste the results of npx -p @storybook/cli@next sb info here. System: OS: macOS 10.15.2 CPU: (8) x64 Intel® Core™ i7-7820HQ CPU @ 2.90GHz Binaries: Node: 11.12.0 - ~/.nvm/versions/node/v11.12.0/bin/node Yarn: 1.21.1 - /usr/local/bin/yarn npm: 6.7.0 - ~/.nvm/versions/node/v11.12.0/bin/npm Browsers: Chrome: 79.0.3945.117 Firefox: 69.0.2 Safari: 13.0.4 npmPackages: @storybook/addon-a11y: ^5.3.2 => 5.3.2 @storybook/addon-actions: ^5.3.2 => 5.3.2 @storybook/addon-docs: ^5.2.8 => 5.2.8 @storybook/addon-info: ^5.3.2 => 5.3.2 @storybook/addon-links: ^5.3.1 => 5.3.1 @storybook/addons: ^5.2.6 => 5.3.2 @storybook/react: ^5.3.2 => 5.3.2 Additional context Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
kelly-tockcommented, Jan 15, 2020

I’ll try and put one together. With just upgrading actions I can clearly see a axios being added via yarn.lock. I think his may be related to node fetch versions from isomorphic fetch and something in the dependencies with this. 5.2.8 works perfectly fine, so something has changed.

0reactions
kelly-tockcommented, Jan 22, 2020

https://github.com/lquixada/cross-fetch/issues/15 was my inspiration for fixing this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Storybook 6 Migration Guide
This guide takes you through: Upgrading the Storybook packages; Dealing with breaking changes; Updating to current best practices. We assume you ...
Read more >
Broken build with updated Storybook (5.3) Configuration
I now have a main.js, manager.js, and preview.js. When I publish with npm this is the error I see this, even though the...
Read more >
Storybook breaks after TypeScript upgrade (v3 to v4)
Some details about our project that might be relevant: We're using: yarn workspaces; Storybook 5.3.19 (@storybook/addon-info @storybook/addon- ...
Read more >
@storybook/addon-actions | Yarn - Package Manager
@storybook/addon-actions. owner storybookjs16.7mMIT6.5.15TS vulns 0 vulnerabilities. Get UI feedback when an action is performed on an interactive element.
Read more >
@storybook/addon-actions - npm
Get UI feedback when an action is performed on an interactive element. Latest version: 6.5.14, last published: 13 days ago.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found