1
resposta

[Dúvida] Mensagem que aparece no terminal após rodar o comando npm run build

Quando eu rodei o comando npm run build no VSCode, eu recebi a seguinte mensagem:

> organo@0.1.0 build
> react-scripts build

Creating an optimized production build...
=============

WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.

You may find that it works just fine, or you may not.

SUPPORTED TYPESCRIPT VERSIONS: >=3.3.1 <5.2.0

YOUR TYPESCRIPT VERSION: 5.7.3

Please only submit bug reports when using the officially supported version.

=============
Compiled successfully.

File sizes after gzip:

  46.19 kB  build\static\js\main.149114ab.js
  807 B     build\static\css\main.14a5a8a2.css

The project was built assuming it is hosted at /.
You can control this with the homepage field in your package.json.

The build folder is ready to be deployed.
You may serve it with a static server:

  npm install -g serve
  serve -s build

Find out more about deployment here:

  https://cra.link/deployment

Por mais que ele tenha dado sinal verde pra eu fazer o deploy da aplicação, eu não entendi o começo da mensagem, especificamente a seguinte parte:

WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.

You may find that it works just fine, or you may not.

SUPPORTED TYPESCRIPT VERSIONS: >=3.3.1 <5.2.0

YOUR TYPESCRIPT VERSION: 5.7.3

Algueém pode me explicar isso, por favor?

1 resposta

Essa mensagem indica que a versão do TypeScript que você está usando (5.7.3) não é oficialmente suportada pelo @typescript-eslint/typescript-estree, que é um parser utilizado pelo ESLint para analisar código TypeScript. A biblioteca aceita apenas versões entre 3.3.1 e 5.2.0, então pode haver incompatibilidades.

Se quiser evitar esse aviso e possíveis erros futuros, pode instalar uma versão suportada com:

npm install typescript@5.1.6 --save-dev

Isso mantém seu projeto dentro do intervalo recomendado.