diff --git a/code/frameworks/nextjs/src/portable-stories.ts b/code/frameworks/nextjs/src/portable-stories.ts index bc00b0ba9f18..e682a103ef24 100644 --- a/code/frameworks/nextjs/src/portable-stories.ts +++ b/code/frameworks/nextjs/src/portable-stories.ts @@ -16,6 +16,7 @@ import type { // ! ATTENTION: This needs to be a relative import so it gets prebundled. This is to avoid ESM issues in Nextjs + Jest setups import { INTERNAL_DEFAULT_PROJECT_ANNOTATIONS as reactAnnotations } from '../../../renderers/react/src/portable-stories'; +import * as rscAnnotations from '../../../renderers/react/src/entry-preview-rsc'; import * as nextJsAnnotations from './preview'; import type { ReactRenderer, Meta } from '@storybook/react'; @@ -46,6 +47,7 @@ export function setProjectAnnotations( // This will not be necessary once we have auto preset loading const defaultProjectAnnotations: ProjectAnnotations = composeConfigs([ reactAnnotations, + rscAnnotations, nextJsAnnotations, ]); diff --git a/code/renderers/react/src/preset.ts b/code/renderers/react/src/preset.ts index 28c667570efc..fdd5add72485 100644 --- a/code/renderers/react/src/preset.ts +++ b/code/renderers/react/src/preset.ts @@ -11,6 +11,7 @@ export const previewAnnotations: PresetProperty<'previewAnnotations'> = async ( options ) => { const docsConfig = await options.presets.apply('docs', {}, options); + const features = await options.presets.apply('features', {}, options); const docsEnabled = Object.keys(docsConfig).length > 0; const result: string[] = []; @@ -18,7 +19,7 @@ export const previewAnnotations: PresetProperty<'previewAnnotations'> = async ( .concat(input) .concat([join(__dirname, 'entry-preview.mjs')]) .concat(docsEnabled ? [join(__dirname, 'entry-preview-docs.mjs')] : []) - .concat(FEATURES?.experimentalRSC ? [join(__dirname, 'entry-preview-rsc.mjs')] : []); + .concat(features?.experimentalRSC ? [join(__dirname, 'entry-preview-rsc.mjs')] : []); }; /**