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.

how to import in next.config

See original GitHub issue

i have this in my next.config.js

`const nextTranslate = require(“next-translate”);

module.exports = { images: { domains: [“cdn.ztona.org”], }, serverRuntimeConfig: { mySecret: “secret”, xauth: process.env.XAUTH, url: process.env.URL, }, publicRuntimeConfig: { // Will be available on both server and client staticFolder: “/static”, xauth: process.env.XAUTH, url: process.env.URL, siteName: process.env.SITE_NAME, }, };`

how i can import with nextTranslate() plugin please

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
aralrocacommented, May 20, 2021

You need to create the file i18n.js in the root of the project with the next-translate configuration 😉

0reactions
kotsh23commented, May 20, 2021

@aralroca Thank you bro worked fine but i have another problem 😄

now i have inside pages/[category]/index.js and [single].jsx

if i switch lang to another i have new name space localhost:3000/ar

and i use router.query to fetch category name now system read “ar” as category , (router.query.category)

any hint how to fix it , i dont need to add name space at url or any idea about how to handle it 👯

Read more comments on GitHub >

github_iconTop Results From Across the Web

next.config.js: Introduction
next.config.js is a regular Node.js module, not a JSON file. It gets used by the Next.js server and build ... Phases can be...
Read more >
Support ESM in next.config.js - Stack Overflow
From Next.js 12, ES modules is now supported in the config file by renaming it to next.config.mjs . // next.config.mjs import withLess from ......
Read more >
Import config values from next.config.js #23180 - GitHub
Is there any way of importing configuration values from next.config.js ? For example, I'd like to access the i18n defaultLocale value:.
Read more >
How to use the next/config function in next - Snyk
How to use the next/config function in next · To help you get started, we've selected a few next examples, based on popular...
Read more >
Nice imports with Next.js - Remy Sharp
Add the next.config.js file to your project then it needs to add to the webpack.config.resolve.alias object: const path = require('path'); ...
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