0

I want to build a web application bundle for my flutter project by using the command 'flutter build web'. However, I face an error i.e.

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:

I can run the app in debug mode but can't build the web bundle.

  • error says there are some packages that they don't support null safety. so you should find those packages and make sure they support null safety. – Zahra Jun 12 '22 at 10:04
  • I had done that as well, but it wasn’t working, however when I updated the package that was throwing the error, it worked. – Zameer Khan Jun 14 '22 at 17:35

2 Answers2

1

Apparently one of your packages does not support Null Safety and needs to be removed for your application to work. The error message should tell you which package is affected.

There is no way to continue using it without effort, as it is deprecated and apparently not being developed further. You can fork the package and implement the null safety yourself, which should not be that hard. Or there is already a fork that has implemented it.

Mäddin
  • 1,070
  • 6
  • 11
0

Solved: I updated the package that was the cause of the error, and it works now.