-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
fix: storybook can use next-i18next in webpack@5 setup #44
base: main
Are you sure you want to change the base?
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/natterstefan/nextjs-template/CsXkLGWy49Sj5Ckfa3rt4tg5wvMk |
6f95bee
to
a6aa380
Compare
Status Update for anyone reading this Storybook i18n Setup
There was also an update in the docs of Vercel Deployment IssueI also experienced other issues in that Vercel is not able to find the translation files when deploying Storybook with
Solution (hack IMHO)/* eslint-disable @typescript-eslint/no-var-requires */
const path = require('path')
/**
* HACK: make sure Vercel includes those files
*/
if (typeof window === 'undefined') {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const _files = path.resolve('./public/locales')
}
/**
* Docs:
* @see https://nextjs.org/docs/advanced-features/i18n-routing
* @type {import('next').NextConfig["i18n"]}
*/
const i18n = {
defaultLocale: 'en',
locales: ['en', 'de'],
// without the need to add this line
// localePath: path.resolve('./public/locales'),
}
module.exports = {
i18n,
} |
TASK
Issues
Tasks
next-i18next
webpack@5
as well with that example repowebpack@5 vs. webpack@4
Screenshot of the issue
This is the warning I am struggling with:
react-i18next:: You will need to pass in an i18next instance by using initReactI18next
. Because it does not load translations when I get this error...