Skip to content

Commit

Permalink
Allow Next.js project not having a next.config file
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinpalkovic committed Dec 6, 2022
1 parent 8fb8c8b commit 256c4f7
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions code/frameworks/nextjs/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,7 @@ export const resolveNextConfig = async ({
const nextConfigFile = nextConfigPath || (await findNextConfigFile(configDir));

if (!nextConfigFile || (await pathExists(nextConfigFile)) === false) {
throw new Error(
dedent`
Could not find or resolve your Next config file. Please provide the next config file path as a framework option.
More info: https://github.com/storybookjs/storybook/blob/next/code/frameworks/nextjs/README.md#options
`
);
return {};
}

const nextConfigExport = await import(pathToFileURL(nextConfigFile).href);
Expand Down

0 comments on commit 256c4f7

Please sign in to comment.