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

360
Vistas
Next.js app with both Javascript and Typescript

I have a Next.js app written in Javascript, and planning on starting to write new code in Typescript. I tried adding Typescript to the project by running touch tsconfig.json at the project root And

npm install --save-dev typescript @types/react @types/node

And when I try to run npm run dev I get an error

error - ./pages/_app.js:6:0
Module not found: Can't resolve 'src/assets/styles/index.scss'

And pretty much all modules cannot be imported.

What do I need to configure in order to work with both Javascript and Typescript?

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

0

Stopping and restarting the server should fix most of your module import issues.

SCSS should be ready to go but if it continues after the restart, declaring it in a typescript declaration file should resolve it.

// index.d.ts
declare module '*.scss';
about 4 years ago · Juan Pablo Isaza Denunciar

0

Adding to tsconfig.json

"compilerOptions": {
    ...
    "baseUrl": ".",
    ...
}

Resolved this

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