0

We recently started converting our flutter app to web with Flutter 3.0.3 (Dart 2.17.5 • DevTools 2.12.2).

We are facing following errors while executing the web on chrome,

 Error: Unexpected null value.
    at Object.throw_ [as throw] (http://localhost:57060/dart_sdk.js:5080:11)
    at Object.nullCheck (http://localhost:57060/dart_sdk.js:5399:30)
    at auth_repo.AuthRepo._internal.loginUser (http://localhost:57060/packages/our_repo/modules/home/repository/our_db_search.lib.js:24349:77)
    at loginUser.next (<anonymous>)
    at http://localhost:57060/dart_sdk.js:40641:33
    at _RootZone.runUnary (http://localhost:57060/dart_sdk.js:40511:59)
    at _FutureListener.thenAwait.handleValue (http://localhost:57060/dart_sdk.js:35438:29)
    at handleValueCallback (http://localhost:57060/dart_sdk.js:35999:49)
    at _Future._propagateToListeners (http://localhost:57060/dart_sdk.js:36037:17)
    at [_complete] (http://localhost:57060/dart_sdk.js:35864:25)
    at _SyncCompleter.new.complete (http://localhost:57060/dart_sdk.js:35355:31)
    at onValue (http://localhost:57060/dart_sdk.js:35118:49)
    at _RootZone.runUnary (http://localhost:57060/dart_sdk.js:40511:59)
    at _FutureListener.then.handleValue (http://localhost:57060/dart_sdk.js:35438:29)
    at handleValueCallback (http://localhost:57060/dart_sdk.js:35999:49)
    at _Future._propagateToListeners (http://localhost:57060/dart_sdk.js:36037:17)
    at [_completeWithValue] (http://localhost:57060/dart_sdk.js:35872:23)
    at async._AsyncCallbackEntry.new.callback (http://localhost:57060/dart_sdk.js:35906:35)
    at Object._microtaskLoop (http://localhost:57060/dart_sdk.js:40778:13)
    at _startMicrotaskLoop (http://localhost:57060/dart_sdk.js:40784:13)
    at http://localhost:57060/dart_sdk.js:36261:9

Clicking on any error takes to web browser and shows "Internal Server Error". Its very difficult to debug these errors as they seem to be related to tool or setup.

Has anyone experienced this issue with their web project? Please let us know if you need any additional information.

Thanks in advance

user3600064
  • 61
  • 1
  • 3
  • Does this error occur when compiling for the web or during runtime? if former try recreating web folder by deleting web folder and running `flutter create .` Before you do this, Note that if you have made any configuration in web folder they will be lost and you will need to reconfigure – Mahesh Jamdade Jul 31 '22 at 14:37
  • Thank for your response @MaheshJamdade. The error occurs during runtime. Also, we are using Android Studio for our development. – user3600064 Jul 31 '22 at 21:44
  • Okay then try to identify which particular action in your code generates that issue. Could be any click events, navigation or network call etc. If you find it please consider sharing a sample code. – Mahesh Jamdade Aug 01 '22 at 02:43
  • Thanks @MaheshJamdade. Actually identifying the issue is very difficult as the clicking on error doesnt take us to the problematic area. We have been adding prints throughout the code to identify the issue and fix it but it is not sustainable solution. – user3600064 Aug 01 '22 at 03:53

0 Answers0