Error while running 'next start' with next-translate configuration
Hi,
I am using next-translate in my app followed the readme given here next-translate.
It runs without issues when i do 'yarn dev'. However it fails when i do "next build && next start" with below given error. This is noticed only with next-translate configuration. if i remove next-translate configuration from next.config.js it works perfectly fine. Can any one please help what is wrong here.
TypeError: argument entity must be string, Buffer, or fs.Stats
at etag (C:\~\~`\AppData\Roaming\npm\node_modules\next\dist\compiled\etag\index.js:1:944)
// next.confg.ts
module.exports = withPlugins([nextTranslate], nextConfig);
// i18n.js
module.exports = {
locales: ['en'],
defaultLocale: 'en',
pages: {
'*': ['common'],
'/': ['home'],
},
loadLocaleFrom: (lang, ns) =>
// You can use a dynamic import, fetch, whatever. You should
// return a Promise with the JSON file.
import(`./public/locales/${lang}/${ns}.json`).then((m) => m.default),
}
@pramod-bhandarkar if you replace
module.exports = withPlugins([nextTranslate], nextConfig);
to
module.exports = nextTranslate(nextConfig);
still not working?
@aralroca i have tried that way as well, unfortunately did not work!
@pramod-bhandarkar what version of Next.js and next-translate do you use?
@aralroca My Next version is 11.1.2 and next-translate is 1.0.7.
Thanks.
@aralroca am i using incompatible next? I saw the version requirement for next-translate is 10.1.3.
No idea. I tried and it works well. I can't reproduce your issue. If you can share your project or an example repo with the error it would be great to see what it is. Thanks!