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

Ensure v6 store works even with no explicit renderer #19624

Merged
merged 2 commits into from
Oct 26, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions code/lib/core-common/src/utils/get-renderer-name.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { dedent } from 'ts-dedent';
import type { Options } from '@storybook/types';
import { getFrameworkName } from './get-framework-name';

/**
* Render is set as a string on core. It must be set by the framework
Expand All @@ -8,11 +8,10 @@ export async function getRendererName(options: Options) {
const { renderer } = await options.presets.apply('core', {}, options);

if (!renderer) {
throw new Error(dedent`
You must specify a framework in '.storybook/main.js' config.

https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#framework-field-mandatory
`);
console.log('getting framework name');
tmeasday marked this conversation as resolved.
Show resolved Hide resolved
// At the moment some frameworks (Angular/Ember) do not define a renderer, but themselves
// serve the purpose (in particular exporting the symbols needed by entrypoints)
return getFrameworkName(options);
}

return renderer;
Expand Down