Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with next-intl and intl-messageformat #12

Open
1 of 4 tasks
sebpalluel opened this issue Dec 13, 2023 · 2 comments
Open
1 of 4 tasks

Error with next-intl and intl-messageformat #12

sebpalluel opened this issue Dec 13, 2023 · 2 comments

Comments

@sebpalluel
Copy link

Current Behavior

When launching my storybook with the latest version of storybook-addon-module-mock i get this error on stories where i have translation using variables:

Error: INVALID_MESSAGE: Cannot read properties of undefined (reading 'date')
    at getFallbackFromErrorAndNotify (createFormatter-56ef3976.js:152:1)
    at translateBaseFn (createFormatter-56ef3976.js:209:1)
    at translateFn (createFormatter-56ef3976.js:239:1)
    at NextIntlTest ((index):16:1)
    at renderWithHooks (react-dom.development.js:11009:1)
    at mountIndeterminateComponent (react-dom.development.js:16761:1)
    at beginWork$1 (react-dom.development.js:18345:1)
    at beginWork (react-dom.development.js:26741:1)
    at performUnitOfWork (react-dom.development.js:25587:1)
    at workLoopSync (react-dom.development.js:25303:1)
defaultOnError @ initializeConfig-c503e215.js:74
getFallbackFromErrorAndNotify @ createFormatter-56ef3976.js:153
translateBaseFn @ createFormatter-56ef3976.js:209
translateFn @ createFormatter-56ef3976.js:239
NextIntlTest @ (index):16
renderWithHooks @ react-dom.development.js:11009
mountIndeterminateComponent @ react-dom.development.js:16761
beginWork$1 @ react-dom.development.js:18345
beginWork @ react-dom.development.js:26741
performUnitOfWork @ react-dom.development.js:25587
workLoopSync @ react-dom.development.js:25303
renderRootSync @ react-dom.development.js:25258
performConcurrentWorkOnRoot @ react-dom.development.js:24382
workLoop @ scheduler.development.js:261
flushWork @ scheduler.development.js:230
performWorkUntilDeadline @ scheduler.development.js:534
...

GitHub Repo

https://github.com/sebpalluel/storybook-rsc-demo-next-intl-module-mock

Steps to Reproduce

  1. pnpm i
  2. pnpm dev It will display the next app with correct translations
  3. pnpm storybook and go to http://localhost:6006/?path=/story/nextintltest--default

The text Hello World! is correctly displayed but the one bellow with the variable This is a text with a number 10

If i remove 'storybook-addon-module-mock' from the storybook addons it's displaying correctly.

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

This repo is a fork of the original demo for RSC: https://github.com/shilman/storybook-rsc-demo

@sebpalluel
Copy link
Author

Any update on this ? It's breaking a handful of my stories.

@betgo
Copy link

betgo commented Dec 19, 2024

same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants