Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

268
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda