diff --git a/code/lib/csf-tools/src/CsfFile.test.ts b/code/lib/csf-tools/src/CsfFile.test.ts index bc6b319ebcc8..2784c6f19f38 100644 --- a/code/lib/csf-tools/src/CsfFile.test.ts +++ b/code/lib/csf-tools/src/CsfFile.test.ts @@ -556,7 +556,7 @@ describe('CsfFile', () => { `, true ) - ).toThrow('CSF: unexpected storiesOf call'); + ).toThrow('Unexpected `storiesOf` usage:'); }); it('function exports', () => { diff --git a/code/lib/csf-tools/src/CsfFile.ts b/code/lib/csf-tools/src/CsfFile.ts index 266dd66027d4..bc0d6400827e 100644 --- a/code/lib/csf-tools/src/CsfFile.ts +++ b/code/lib/csf-tools/src/CsfFile.ts @@ -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 `); } },