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

478
Visualizações
React does not allow importing types from external folders (React + TypeScript)

I have a React project with TypeScript. I'm trying to import types from an external folder - outside of the React folder. However, React does not seem to allow this. I'm using craco on top of CRA to run the app.

Project: https://github.com/accord-dot-app/app

types/
- ...
- deps.types.ts

frontend/
- ...
- src/
-- index.tsx

types/deps.types.ts:

// ... imports

export interface Deps {
...
}

frontend/src/index.tsx:

import { Deps } from '.../deps.types.ts';

...

This is the error I get when running craco start.

File was processed with these loaders:
 * ./node_modules/react-scripts/node_modules/@pmmmwh/react-refresh-webpack-plugin/loader/index.js
You may need an additional loader to handle the result of these loaders.
| import ChannelLeave from '@accord/backend/ws/ws-events/channel-leave';
|
> declare interface Deps {
|   channels: Channels;
|   /** @deprecated */

If I comment out the lines, I just get another error in a another similar type file.

How can the errors be removed?

about 4 years ago · Santiago Trujillo
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