Replies: 3 comments 17 replies
-
You're seeing this error because you're invoking I'll move this to a discussion since it's a usage question. |
Beta Was this translation helpful? Give feedback.
-
I'm facing issues using getTranslations in Storybook 8.0 alpha with its new React Server Components (RSC) support. maybe its possible to mock getTranslation in some way. 'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
/**
* Allows to import `next-intl/server` in non-RSC environments.
*
* This is mostly relevant for testing, since e.g. a `generateMetadata`
* export from a page might use `next-intl/server`, but the test
* only uses the default export for a page.
*/
function notSupported(message) {
return () => {
throw new Error("`".concat(message, "` is not supported in Client Components."));
};
} |
Beta Was this translation helpful? Give feedback.
-
Hmm this worked flawlessly, until I had pages that had two different Currently mocking it like this
|
Beta Was this translation helpful? Give feedback.
-
Description
I setup Option 4 in my storybook and nextjs application
in nextjs application, the Option 4 setup works well. but in storybook, storybook makes an error even if i wrapping Story Component with
<NextIntlClientProvider>
as follow :You can verify specific symptoms through CodeSandbox.
Mandatory reproduction URL (CodeSandbox or GitHub repository)
https://codesandbox.io/p/devbox/next-intl-bug-template-app-forked-pxyx5n?file=%2F.storybook%2Fpreview.tsx%3A10%2C7&workspaceId=3b663f32-b4b0-43b5-9910-dc5ef7e82cb5
Reproduction description
Steps to reproduce:
yarn sb
in terminalExpected behaviour
Storybook must not make an error
Beta Was this translation helpful? Give feedback.
All reactions