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

249
Visualizações
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 à 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