next-translate icon indicating copy to clipboard operation
next-translate copied to clipboard

Error while running 'next start' with next-translate configuration

Open pramod-bhandarkar opened this issue 4 years ago • 6 comments

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 avatar Sep 09 '21 17:09 pramod-bhandarkar

@pramod-bhandarkar if you replace

module.exports = withPlugins([nextTranslate], nextConfig);

to

module.exports = nextTranslate(nextConfig);

still not working?

aralroca avatar Sep 10 '21 07:09 aralroca

@aralroca i have tried that way as well, unfortunately did not work!

pramod-bhandarkar avatar Sep 10 '21 10:09 pramod-bhandarkar

@pramod-bhandarkar what version of Next.js and next-translate do you use?

aralroca avatar Sep 10 '21 10:09 aralroca

@aralroca My Next version is 11.1.2 and next-translate is 1.0.7.

Thanks.

pramod-bhandarkar avatar Sep 13 '21 05:09 pramod-bhandarkar

@aralroca am i using incompatible next? I saw the version requirement for next-translate is 10.1.3.

pramod-bhandarkar avatar Sep 13 '21 15:09 pramod-bhandarkar

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!

aralroca avatar Sep 15 '21 11:09 aralroca