Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Error - No configuration files have been found in your configDir #259

Closed
drewbaker opened this issue Apr 9, 2021 · 5 comments
Closed
Labels
type: bug Something isn't working

Comments

@drewbaker
Copy link

Version

@nuxtjs/storybook:
nuxt:

Steps to reproduce

npm install --save-dev @nuxtjs/storybook

Then:
npx nuxt storybook build

What is Expected?

That the storybook gets built into a static directory.

What is actually happening?

At static build, it crashes with the following error. Notice how it is complaining about /.storybook but I'd expect that should be .nuxt-storybook. Maybe that is the issue?

The regular npx nuxt storybook runs fine, it's just the static build that is failing.

ERR! Error: No configuration files have been found in your configDir (/Users/drew/Sites/library-website-nuxt/.storybook).
ERR! Storybook needs either a "main" or "config" file.
ERR!     at validateConfigurationFiles (/Users/drew/Sites/library-website-nuxt/node_modules/@storybook/core-common/dist/cjs/utils/validate-c
onfiguration-files.js:50:11)
ERR!     at loadCustomPresets (/Users/drew/Sites/library-website-nuxt/node_modules/@storybook/core-common/dist/cjs/utils/load-custom-presets
.js:19:62)
ERR!     at loadAllPresets (/Users/drew/Sites/library-website-nuxt/node_modules/@storybook/core-common/dist/cjs/presets.js:310:105)
ERR!     at buildStaticStandalone (/Users/drew/Sites/library-website-nuxt/node_modules/@storybook/core-server/dist/cjs/build-static.js:95:48
)
ERR!     at async Object.buildStatic (/Users/drew/Sites/library-website-nuxt/node_modules/@storybook/core-server/dist/cjs/build-static.js:14
2:5)
ERR!  Error: No configuration files have been found in your configDir (/Users/drew/Sites/library-website-nuxt/.storybook).
ERR! Storybook needs either a "main" or "config" file.
ERR!     at validateConfigurationFiles (/Users/drew/Sites/library-website-nuxt/node_modules/@storybook/core-common/dist/cjs/utils/validate-c
onfiguration-files.js:50:11)
ERR!     at loadCustomPresets (/Users/drew/Sites/library-website-nuxt/node_modules/@storybook/core-common/dist/cjs/utils/load-custom-presets
.js:19:62)
ERR!     at loadAllPresets (/Users/drew/Sites/library-website-nuxt/node_modules/@storybook/core-common/dist/cjs/presets.js:310:105)
ERR!     at buildStaticStandalone (/Users/drew/Sites/library-website-nuxt/node_modules/@storybook/core-server/dist/cjs/build-static.js:95:48
)
ERR!     at async Object.buildStatic (/Users/drew/Sites/library-website-nuxt/node_modules/@storybook/core-server/dist/cjs/build-static.js:14
2:5)

My storybook config in nuxt.config.js is this:

storybook: {
        stories: ["~/stories/**/*.stories.js"],
        parameters: {
            layout: "fullscreen",
            backgrounds: {
                default: "default",
                values: [
                    {
                        name: "White",
                        value: "#ffffff",
                    },
                    {
                        name: "Grey",
                        value: "#F2F2F2",
                    },
                    {
                        name: "Dark blue",
                        value: "#032D5B",
                    },
                    {
                        name: "Blue",
                        value: "#0B6AB7",
                    },
                    {
                        name: "Light blue",
                        value: "#EAF2FB",
                    },
                ],
            },
        },
        webpackFinal(config, { configDir }) {
            // Allow webpack to auto-load .gql and .svg files
            config.resolve.extensions.push(".gql", ".svg")

            return config
        },
    },
@drewbaker drewbaker added the type: bug Something isn't working label Apr 9, 2021
@codename-niels
Copy link

I found a temporary workaround.
Setting the SBCONFIG_CONFIG_DIR to ./.nuxt-storybook/storybook works for me:
env SBCONFIG_CONFIG_DIR=./.nuxt-storybook/storybook npx nuxt storybook build

Copy link
Collaborator

Thank for the issue, this feature is breaks in Storybook v6.2. Meanwhile you can use @nielwijers solution

@lihbr
Copy link

lihbr commented Apr 13, 2021

Fixed: storybookjs/storybook#14566 🙌 hopefully will get published in a few days~

Edit: will be part of 6.3 actually :c storybookjs/storybook#14561 (comment)

Edit 2: It's released on 6.2.8, everyone can upgrade their dependency and we can close this issue 🎉

@lihbr
Copy link

lihbr commented Apr 14, 2021

^ @farnabaz + https://github.com/storybookjs/storybook/releases/tag/v6.2.8 ☺️

@farnabaz
Copy link
Collaborator

Just released v4.0.2 with Storybook@6.2.8
Thank to @lihbr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants