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

296
Vistas
Cannot export Interface in Typescirpt - the requested module does not provide an export named Settings

I am trying to export/import an interface in Typescript but I am getting this error, I am not sure what I am doing wrong here

Uncaught SyntaxError: The requested module '/src/types/settings.ts' does not provide an export named 'Settings'

In my types/settings.ts I have this

export interface Settings {
    activeUser: number
}

And I import it like this

import { Settings } from '@/types/settings'

And here is my tsconfig.json

{
  "compilerOptions": {
    "target": "esnext",
    "baseUrl": "./src/",
    "useDefineForClassFields": true,
    "module": "esnext",
    "moduleResolution": "node",
    "strict": true,
    "jsx": "preserve",
    "paths": {
      "@/*": ["src/*"],
    },
    "sourceMap": true,
    "resolveJsonModule": true,
    "esModuleInterop": true,
    "lib": ["esnext", "dom"],
    "isolatedModules": false
  },

  "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"]
}

I am using Vue/Vite with Typescript

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

It is weird that npm run build will work fine, but npm run dev will throw SyntaxError.

I was forced to use import type { ... which in consequence also required same touch for Ref from vue.

Workaround was posted on GitHub for Vite issue 731

about 4 years ago · Juan Pablo Isaza Denunciar

0

Entries in paths are resolved relative to baseUrl. Try this:

{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "@/*": ["src/*"]
    }
  }
}

… or this:

{
  "compilerOptions": {
    "baseUrl": "./src/",
    "paths": {
      "@/*": ["./*"]
    }
  }
}
about 4 years ago · Juan Pablo Isaza 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