Merge pull request #20253 from storybookjs/20252-fix-ssv6

Fix issues with running SSv6
This commit is contained in:
Tom Coleman 2022-12-14 19:36:15 +11:00 committed by GitHub
commit 00da7f9d5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 9 deletions

View File

@ -147,8 +147,6 @@ export default async (
previewAnnotations.forEach((previewAnnotationFilename: string | undefined) => {
if (!previewAnnotationFilename) return;
const previewApi = storybookPaths['@storybook/preview-api'];
const clientLogger = storybookPaths['@storybook/client-logger'];
// Ensure that relative paths end up mapped to a filename in the cwd, so a later import
// of the `previewAnnotationFilename` in the template works.
@ -159,8 +157,6 @@ export default async (
// file, see https://github.com/storybookjs/storybook/pull/16727#issuecomment-986485173
virtualModuleMapping[entryFilename] = interpolate(entryTemplate, {
previewAnnotationFilename,
previewApi,
clientLogger,
});
entries.push(entryFilename);
});

View File

@ -9,7 +9,7 @@ import {
addArgsEnhancer,
addArgTypesEnhancer,
setGlobalRender,
} from '{{previewApi}}';
} from '@storybook/preview-api';
import * as previewAnnotations from '{{previewAnnotationFilename}}';
Object.keys(previewAnnotations).forEach((key) => {

View File

@ -71,11 +71,15 @@ const createCanvas = (id: string, baseUrl = 'iframe.html', withLoader = true): A
useEffect(() => {
if (global.CONFIG_TYPE === 'DEVELOPMENT') {
const channel = addons.getServerChannel();
try {
const channel = addons.getServerChannel();
channel.on(PREVIEW_BUILDER_PROGRESS, (options) => {
setProgress(options);
});
channel.on(PREVIEW_BUILDER_PROGRESS, (options) => {
setProgress(options);
});
} catch {
//
}
}
}, []);