Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

356
Views
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 answers
Answer question

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 Report

0

Adding to tsconfig.json

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

Resolved this

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!