Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

267
Visualizações
Getting 'ambiguous indirect export' error in JavaScript/TypeScript

I am getting this error: Syntax Error: ambiguous indirect export in Firefox. Sadly there is nothing to find at Google...

  • This is my import:
<script type="module">
    import {someFunctionINeed} from "./js/functions.js";
    ...
</script>
  • This is my export:
export function someFunctionINeed(cname) { ... }
  • a part from my tsconfig.json:
"compilerOptions": {
    "module": "commonjs",
    "target": "es5",
    "sourceMap": true,
    "watch": true,
    "removeComments": true
}
  • and something that's maybe relevant from the package.json:
"type": "module"

What did I miss?

almost 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

El error "exportación indirecta ambigua" en JavaScript o TypeScript ocurre cuando tienes dos o más módulos que exportan elementos con el mismo nombre, y luego intentas importar esos elementos en otro módulo sin especificar cuál de los elementos quieres importar. Para solucionar este error, debes ser más específico en tu declaración de importación o cambiar los nombres de los elementos exportados para que sean únicos. Aquí tienes algunas opciones:

Importar elementos específicos:

Si tienes dos módulos que exportan elementos con el mismo nombre y deseas importar uno de ellos, puedes ser específico en tu declaración de importación:

If you encounter the "ambiguous indirect export" error in your JavaScript or TypeScript code, here are some possible solutions you can try:

  1. Rename exports: Make sure your modules' exports have unique names and do not conflict with other modules. If you are using default exports ( export default ) and named exports ( export const ), check that they do not have duplicate names.

  2. Specific Imports: Instead of importing the entire module with import * as modulo from 'ruta' , try importing only the specific parts you need. For example, you can do: import { función } from 'ruta' .

  3. Using import aliases: You can use aliases in your imports to avoid naming conflicts. For example: import { función as miFuncion } from 'ruta' .

  4. Check your project structure: Make sure your project structure is consistent and avoid placing files with similar names in the same directory, which could cause confusion.

  5. Check your dependencies: Sometimes this error can be caused by conflicts in your project dependencies. Make sure your dependencies are up to date and compatible.

These solutions should help you fix the "Ambiguous Indirect Export" error in your code and keep it cleaner and easier to maintain. Remember that resolving name conflicts and properly organizing the project are key practices to prevent these types of errors.

In short, the "ambiguous indirect export" error occurs when you try to import elements with the same name from multiple modules without specifying which one you want to import. The proposed solutions such as renaming exports, using specific imports or import aliases, checking project structure and dependencies are useful tips to address this issue.

almost 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda