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

Core: Update error message from storiesOf usage. #21451

Merged
merged 3 commits into from
Mar 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion code/lib/csf-tools/src/CsfFile.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ describe('CsfFile', () => {
`,
true
)
).toThrow('CSF: unexpected storiesOf call');
).toThrow('Unexpected `storiesOf` usage:');
});

it('function exports', () => {
Expand Down
5 changes: 3 additions & 2 deletions code/lib/csf-tools/src/CsfFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -414,9 +414,10 @@ export class CsfFile {
const { callee } = node;
if (t.isIdentifier(callee) && callee.name === 'storiesOf') {
throw new Error(dedent`
CSF: unexpected storiesOf call ${formatLocation(node, self._fileName)}
Unexpected \`storiesOf\` usage: ${formatLocation(node, self._fileName)}.

More info: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#story-store-v7
In SB7, we use the next-generation \`storyStoreV7\` by default, which does not support \`storiesOf\`.
More info, with details about how to opt-out here: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#storystorev7-enabled-by-default
`);
}
},
Expand Down