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

519
Vistas
TypeScript file is not a module

I'm beginner with TypeScript, and I have one very simple problem. I'm trying to import file, so I could import interface. For example:

Parent:

import { User } from "@/Users";
    
export interface Gift {
  id: number;
  user: User;
  created_at: Date,
  updated_at: Date
}

Child (User.ts):

export interface User {
    id: string;
    first_name: string,
    last_name: string,
    email: string,
    created_at: string,
    updated_at: string
}

So it's giving error

File 'somepathhere/Users.ts' is not a module

In my case, Users.ts has only this interface, and nothing else, but parent component has some functions, but it's using User interface only this time.

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

0

The import statement should be import {User} from './User'

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