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

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

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 Report

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 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!