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

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

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