question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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),
}

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
aralrocacommented, Sep 10, 2021

@pramod-bhandarkar if you replace

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

to

module.exports = nextTranslate(nextConfig);

still not working?

0reactions
aralrocacommented, Sep 15, 2021

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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

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'....
Read more >
next.js - How to add next-translate to next.config - Stack Overflow
You have to add your custom nextConfig as a parameter to nextTranslate() . Use this code: const nextTranslate = require('next-translate') ...
Read more >
next-config-error - Next.js
When attempting to load your next.config.js or next.config.mjs file, an error occurred. This could be due to a syntax error or attempting to...
Read more >
@autushka/next-translate - npm package | Snyk
Learn more about @autushka/next-translate: package health score, ... Get started free ... Add a configuration file i18n.json in the root of the project....
Read more >
Next-translate NPM - npm.io
An array with all the routes to ignore in the middleware. This config property only effect using a custom server with the i18nMiddleware...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found