fix: storybook can use next-i18next in webpack@5 setup#44
fix: storybook can use next-i18next in webpack@5 setup#44natterstefan wants to merge 3 commits intomainfrom
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-i18nextwebpack@5as 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...