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

257
Views
Webpack - Cannot resolve module

I've had a problem with webpack, after run webpack --progress --color --config webpack.dev.js I've had 184 errors like below:

ERROR in ./src/features/settings/SettingsNotificationsPage.tsx 2:0-107
Module not found: Error: Can't resolve 'src/features/settings/components/DashboardSettingsNavigation' in '...'

In my SettingsNotificationsPage i'm import DashbaordSettingsNavigation like here

import { DashboardSettingsNavigation } from "src/features/settings/components/DashboardSettingsNavigation";

and is correct but when webpack try to build my project then many of this import explode.

Can someone tell me what i'm doing wrong?

Thanks for any help!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I get this error when using src/ path in reactjs.

Solutions

Without any additional config

Updating your src/ path with a relative import should do the trick.

then your import became

import { DashboardSettingsNavigation } from "./components/DashboardSettingsNavigation";

based on the fact your import is made from /src/features/settings/SettingsNotificationsPage.tsx

Adding/updating jsconfig/tsconfig as follow

If you add a js/ts configuration setting baseUrl to "src" you should be able to import src/features/... as features/... without the need of using relative import.

Your jsconfig.json/tsconfig.json should be something like

{
    "compilerOptions": {
      ..., 
      "baseUrl": "src"
    },
    "include": ["src"]
}

then your import became

import { DashboardSettingsNavigation } from "features/settings/components/DashboardSettingsNavigation";
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!