Closed TomzBench closed 3 years ago
Do you have a .storybook/main.js
file? This is loaded as well, and might contain some configuration for regular storybook.
Yes, I stripped everything to keep it simple:
module.exports = {
stories: ['../src/**/*.stories.ts'],
};
seems related to the knobs plugin. I don't mind disabling all the plugins to just have some bare storybook running. Is it possible to disable plugins?
I notice the "knobs" addon isn't part of the prebuilt, yet some how my setup is adding it. Hmm. The index.html that is loaded to my browser is
<!DOCTYPE html><html><head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Storybook</title>
<style>
html,
body {
overflow: hidden;
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}
</style>
<style>
#root[hidden],
#docs-root[hidden] {
display: none !important;
}
</style>
</head>
<body>
<div id="root"></div>
<div id="docs-root"></div>
<script type="module">
import './node_modules/@web/storybook-prebuilt/manager.js';
import '@storybook/addon-knobs/register';
</script>
</body></html>
So the knobs addon is coming from my html. Not sure why though
I used the --app-index
arg to pass the index page explicitly. So I passed the same html but deleted the import knob addon from the script tag. But then I receive this error
Loading module from “http://localhost:8000/{...}/node_modules/@web/storybook-prebuilt/manager.js” was blocked because of a disallowed MIME type (“text/plain”).
That's strange, this import must come from somewhere. You're certain there is no main.js file somewhere interfering? I have added an example project here: https://github.com/modernweb-dev/example-projects/tree/master/storybook
Yes I was running with the assumption of the wrong .storybook
config dir. I passed the .storybook
config fold explicitly in the plugin and it worked. Whoops! :)
Hello,
I am following the example here: https://modern-web.dev/docs/dev-server/plugins/storybook/
I receive the following error from my firefox browser:
My config file:
I run the wds with
./node_modules/.bin/web-dev-server --config path/to/config --node-resolve
Perhaps i missed something?