Skip to content

Commit

Permalink
Merge pull request #21451 from storybookjs/20146-fix-storiesOf-warning
Browse files Browse the repository at this point in the history
Core: Update error message from storiesOf usage.
  • Loading branch information
yannbf committed Mar 7, 2023
2 parents a5cccf7 + 35104b8 commit 1d4bb4e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion code/lib/csf-tools/src/CsfFile.test.ts
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
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

0 comments on commit 1d4bb4e

Please sign in to comment.