Storybook - Accessing the body object off the request freezes things up
See original GitHub issueI followed the recommended setup for storybook, and everything works great until I access data off of the request body. The code below is the main thing I’m trying to get working:
rest.post(`/messages`, (req, res, ctx) => {
console.log("HERE ----->", Array.isArray(req.body.keys), req.body.keys)
let response = {}
//const { keys } = req.body
//const keys = [...req.body.keys]
//req.body.keys.forEach((key) => {
// response[key] = key.replaceAll(/\./gi, ' ')
//})
// for (let i = 0; i < req.body.keys.length; i++) {
// keys.push(req.body.keys[i])
// } // const response = keys.reduce((acc, current) => {
// acc[current] = current.replaceAll(/\./gi, ' ') // return acc
// }, {})
return res(
ctx.status(200),
ctx.json(response)
)
})
Any of the commented out code causes the response to hang, and not return. The window freezes and I have to force close it.
Node - 14.9.0 Storybook - 6.0.28 MSW - 0.21.3
I’m not sure what else might be needed, as I don’t see any errors in the console, in the terminal (storybook just shows everything is normal), and the network just hangs without the response coming back.
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Controls - Storybook - JS.ORG
Storybook Controls gives you a graphical UI to interact with a component's arguments dynamically without needing to code. It creates an addon panel...
Read more >Tornado Survivor Stories - National Weather Service
This page offers stories submitted by tornado and hail storm survivors. These accounts have not been verified. If you survived a tornado or...
Read more >Frozen food - Wikipedia
Freezing food slows decomposition by turning residual moisture into ice, inhibiting the growth of most bacterial species. In the food commodity industry, there ......
Read more >Hypothermia - Symptoms and causes - Mayo Clinic
Learn about symptoms, treatment and prevention of hypothermia — a life-threatening condition in which the body loses heat faster than it can ...
Read more >The Advocate | Baton Rouge, Louisiana Breaking New | The ...
The Advocate is Louisiana's leading news source, providing award-winning local and regional news coverage.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sorry I’ve been a little MIA, it has been a busy week at work. I’ll try that first thing tomorrow and let you know what I see.
I’m closing this as I wasn’t able to reproduce the issue in an isolated context. Feel free to create a reproduction repository and post it here for us to look at. Until then the issue is simply non-reproducible.