Describe the bug
I keep receiving the following error when implmenting withKnobs using storybook. This is my current config. I have it creating an '..example.js' on the fly. See attached.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Run as normal with knobs integrated
Screenshots
Code snippets
This creates '...example.js' on the fly
import React from "react";
import path from "path";
import { configure } from "@storybook/react";
import { getStorybook, storiesOf } from "@storybook/react";
import { withKnobs } from '@storybook/addon-knobs';
let getComponentName = filePath =>
path
.dirname(filePath)
.split(path.sep)
.reverse()[0];
let getPackageName = filePath =>
path
.dirname(filePath)
.split(path.sep)
.reverse()[1];
configure(() => {
// Automatically import all examples
const req = require.context(
"../packages",
true,
/^((?!node_modules).)*\.example\.js$/
);
req.keys().forEach(pathToExample => {
const { name, Example } = req(pathToExample);
const componentName = `${getPackageName(pathToExample)}.${getComponentName(
pathToExample
)}`;
//This works
//storiesOf(componentName, module).add(name, () => <Example />)
const stories = storiesOf(componentName, module);
stories.addDecorator(withKnobs);
stories.add(name, () => (
<Example />
));
});
}, module);
export { getStorybook };
System:
@storybook/addon-actions": "^4.1.13",
"@storybook/addon-knobs": "^4.1.13",
"@storybook/addon-links": "^4.1.13",
"@storybook/addon-notes": "^4.1.13",
"@storybook/addons": "^4.1.13",
"@storybook/react": "^3.4.11",
Additional context
Add any other context about the problem here.
Does it work if you addDecorator(withKnobs) globally outside of the configure function?
No, still running into the same issue. It displays no panels found even for my action logger when I remove everything but keep it registered in my 'addons.js' file


@jephjohnson I see the problem. You should be using the same version of everything. So either use @storybook/[email protected] OR use @storybook/addon*@3.4.11 (I suggest using the most recent version).
Closing for now. Please re-open if that wasn't the problem.
Solid!!! Thanks @shilman