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.

Cannot process file /<path>.tsx: Duplicate declaration "Trans"

See original GitHub issue

Describe the bug When running lingui extract I get the error Duplicate declaration "Trans" (“t” seems to be OK).

To Reproduce

Cannot process file /<path>.tsx: Duplicate declaration "Trans"
  15 | // i18n
  16 | import { useI18N, Locale } from 'i18n';
> 17 | import { t, Trans } from '@lingui/macro';

Expected behavior No error on lingui extract

Additional context

{
  "presets": ["next/babel"],
  "plugins": ["macros"],
  "env": {
    "test": {
      "plugins": ["dynamic-import-node"]
    }
  }
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:13
  • Comments:35 (13 by maintainers)

github_iconTop GitHub Comments

10reactions
fhuszticommented, Jan 22, 2021

Thanks guys, changing "extract": "lingui extract" to "extract": "NODE_ENV=development lingui extract" fixed it on my fresh install with NextJS. If I understood correctly what is said here I can keep it like that and not worry about it because it doesn’t need to have NODE_ENV=production when building for prod?

9reactions
Anonymous-dev-vcommented, Oct 6, 2021

The error is still there. Duplicate declaration “Trans”

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot process file /<path>.tsx: Duplicate declaration "Trans"
When running lingui extract I get the error Duplicate declaration "Trans" ("t" seems to be OK). To Reproduce
Read more >
Confusing "duplicate identifier" Typescript error message
If no "files" property is present in a tsconfig.json, the compiler defaults to including all files in the containing directory and subdirectories.
Read more >
babel/plugin-transform-typescript
This plugin adds support for the types syntax used by the TypeScript programming language. However, this plugin does not add the ability to...
Read more >
TypeScript rules for Bazel - GitHub Pages
(Note, if you use Project References this is not the case, TS will know the referenced file is part of the other program.)...
Read more >
rollup.js
mjs import { readFileSync } from 'node:fs'; // Use import.meta.url to make the path relative to the current source file instead of process.cwd()...
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