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

263
Vistas
How to avoid the "requested module does not provide an export named" error in typescript + Vue 3?

I have this interface:

Product.ts

import { Category } from "@/Models/Category";

export interface Product {
    id: number;
    name: string;
    slug: string;
    description: string;
    price: number;
    categories: Category[];
    quantity: number;
}

and Category.ts

import { Product } from "@/Models/Product"

export interface Category {    
    id: number
    name: string
    slug: string
    // relations
    products: Product[]   
}

And then I am getting this error:

Uncaught SyntaxError: The requested module '/src/Models/Product.ts?t=1654212769656' does not provide an export named 'Product' (at Category.ts:1:1)

I try to solve using export default, and remove the brackets in the file that is importing, but the error remains, what can I do?

This is my tsconfig.json

{
  "extends": "@vue/tsconfig/tsconfig.web.json",
  "include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
  "compilerOptions": {    
    "baseUrl": ".",
    "paths": {
      "@/*": ["./src/*"]
    }        
  },

  "references": [
    {
      "path": "./tsconfig.vite-config.json"
    }
  ]
}

Thanks.

about 4 years ago · Juan Pablo Isaza
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