addon-controls: Requests multiplying with each change
See original GitHub issueDescribe the bug When I edit a control value, the number of requests made to do so doubles from the previous attempt:
To Reproduce Steps to reproduce the behavior:
- Set up a Rails app with Webpack.
- Configure
view_component_storybookfor it by following their Getting Started guide. In addition, configure CORS headers according to my comment here, configure asset hosts, and change the root to spec/components/stories. - Create a component using
rails generate component Button button_text. Copy the stories they’ve written in theview_component_storybookREADME intospec/components/stories/button_component_stories.rb, and runrake view_component_storybook:write_stories_json. - Install Storybook with
npx -p @storybook/cli sb init -t html - Override the configs with those I’ve left under
Code snippets. - Run
rails sin one terminal instance andyarn storybookin another. - The browser should open your Storybook instance.
- In either of the stories, change the Button Text control value by adding or removing a character.
Expected behavior
One request is made per change to an attribute.
Screenshots

Code snippets
.storybook/main.js
module.exports = {
stories: ["../spec/components/**/*.stories.json"],
addons: [
"@storybook/addon-controls",
"@storybook/addon-links",
"@storybook/addon-essentials",
],
}
.storybook/preview.js
export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
server: {
url: `http://localhost:3000/rails/stories`,
},
}
Generated JSON
{
"title": "Button Component",
"stories": [
{
"name": "with_short_text",
"parameters": {
"server": {
"id": "button_component/with_short_text"
}
},
"args": {
"button_text": "OK"
},
"argTypes": {
"button_text": {
"control": {
"type": "text"
},
"name": "Button Text"
}
}
},
{
"name": "with_long_text",
"parameters": {
"server": {
"id": "button_component/with_long_text"
}
},
"args": {
"button_text": "Push Me Please!"
},
"argTypes": {
"button_text": {
"control": {
"type": "text"
},
"name": "Button Text"
}
}
}
]
}
System
Environment Info:
System:
OS: Linux 5.9 Manjaro Linux
CPU: (12) x64 AMD Ryzen 5 3600 6-Core Processor
Binaries:
Node: 14.15.5 - ~/.asdf/installs/nodejs/14.15.5/bin/node
Yarn: 1.22.5 - ~/.asdf/installs/nodejs/14.15.5/.npm/bin/yarn
npm: 6.14.11 - ~/.asdf/installs/nodejs/14.15.5/bin/npm
Browsers:
Firefox: 87.0
npmPackages:
@storybook/addon-actions: ^6.2.1 => 6.2.1
@storybook/addon-controls: ^6.2.1 => 6.2.1
@storybook/addon-essentials: ^6.2.1 => 6.2.1
@storybook/addon-links: ^6.2.1 => 6.2.1
@storybook/html: ^6.2.1 => 6.2.1
@storybook/server: ^6.2.1 => 6.2.1
Additional context I imagine it’s probably possible to replicate even without the ViewComponent setup.
The first half of the requests that are sent have this traceback:

The second half of the requests call _renderMain from render.js:95 before the first call to renderMain in the above traceback.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
storybook/addon-controls - npm
Storybook Controls gives you a graphical UI to interact with a component's arguments dynamically, without needing to code. It creates an addon ...
Read more >https://downloads.regulations.gov/EPA-HQ-OAR-2003-...
This new HAP emissions factor significantly changes the numerical value of the floor ( pounds of HAP emissions per ton of resin used)...
Read more >storybookjs/storybook (Raised $170.00) - Issuehunt
addon-controls : Requests multiplying with each change. Unfunded#14436created byboardfish. $0.00. Environment variables in HTML files not working anymore.
Read more >AES WR Partnership LOCATION: 11600
November 17, 2005. On July 28, 2005, AES requested administrative changes to two aspects of the PSD Approval and Permit to Construct Nos....
Read more >Natural Gas Pipeline Company of America LLC - Station 307
Change oil and filter every 1,440 hours of operation or annually, ... The filing of a request by the permittee for a permit...
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 Free
Top 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

I’ve just pulled together a reduced test case and the bug isn’t present. It’s not exactly identical at the time of writing because I haven’t configured some dependencies like Hotwire and Tailwind, but I’ll see if introducing those provokes the bug.
Okay - I found this in the docs, which fits my use case perfectly. However,
Whether I prefix the function with
asyncor not, Storybook claims not to be able to find any stories. They’re definitely there, and if I start Storybook withoutwebpackFinalin the exports, the stories show just fine.