-
Notifications
You must be signed in to change notification settings - Fork 11
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
Use with Vite builder #2
Comments
I actually didn't write that part (Shilman did) so I'm not sure how to change it. If you know how to change it and have it work universally, by all means, please submit a PR 😊 |
There are two proposed fixes to a similar problem here:
The first renames the file to |
@stevensacks @brettdewoody I just stumbled upon this, after running into the same error. Did you ever find a solution? and if it's not part of this code that needs fixing, which github repo should I be looking at? I see that 1 of the 2 PRs above was merged, and the other was closed? But at least in the latest storybook it's still broken. I tried @next, and got this error instead:
But that seems unrelated and happens whether storybook-react-i18next is there or not. For now I've had to completely remove this addon from storybook to keep developing. |
same problem here |
same issue: #11 this issue could also be related, i'm pretty ignorant on ES modules vs CommonJS though. |
I can confirm, a basic starter with storybook-vite breaks after installing this plugin with the |
Hi everyone 👋 I've fixed this by using a Backend (the same I'm using for our Remix-i18next setup 🤗) instead of loading all locale json files. Here you can see my import {initReactI18next} from 'react-i18next';
import i18n from 'i18next';
import Backend from 'i18next-http-backend';
const ns = ['common'];
const supportedLngs = ['en'];
i18n.use(initReactI18next)
.use(Backend)
.init({
//debug: true,
lng: 'en',
fallbackLng: 'en',
interpolation: {
escapeValue: false,
},
react: { useSuspense: false },
defaultNS: 'common',
ns,
supportedLngs,
backend: {
loadPath: '/locales/{{lng}}/{{ns}}.json'
}
});
export default i18n; As you can see I use I have also added Have a nice day 👋 |
Storybook 7 and version 2 of this add-on should work with Vite. |
I'm using Vite (instead of webpack) and when implementing
storybook-react-i18next
there's an error of:due to this file using a
require
statement.Any desire to make this work with Vite? If so I'd like to take a shot at a PR.
The text was updated successfully, but these errors were encountered: