Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

263
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!