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

359
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

0

Adding to tsconfig.json

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

Resolved this

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