Fix Target dart2js failed error: Exception: Warning: The ‘dart2js’ entrypoint script is deprecated, please use ‘dart compile js’ instead. In Flutter

Tiempo de lectura: < 1 minuto

Reading time: < 1 minute

Today we’re going to see how to solve the following error:

Target dart2js failed: Exception: Warning: The 'dart2js' entrypoint script is deprecated, please use 'dart compile js' instead.
Error: Cannot run with sound null safety, because the following dependencies
don't support null safety:

- package:http 
- package:http_parser

This error is related to the outdated http library, as it has deprecated resources.

To solve it, we update this library to the latest available version: https://pub.dev/packages/http

In my case, I try it and it works with:


I hope this helps, have a great day.

Leave a Comment