Upgrading @storybook/addon-actions from 5.2.8 to 5.3.2 breaks fetch?
See original GitHub issueDescribe 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:
- Created 4 years ago
- Comments:8 (2 by maintainers)
Top GitHub Comments
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.
https://github.com/lquixada/cross-fetch/issues/15 was my inspiration for fixing this issue.