1

I have an app which compile flawlessly on iOS and Android, but when I try to compile for web and run it on chrome, I get the following error:

Error: Expected a value of type 'String', but got one of type 'Null'

No clue how to inspect, find out what is wrong. Any help will be appreciate.

UPDATE: here is the stack trace:

Error: Expected a value of type 'String', but got one of type 'Null'
at Object.throw_ [as throw] (http://localhost:5000/dart_sdk.js:5067:11)
at Object.castError (http://localhost:5000/dart_sdk.js:5026:15)
at Object.cast [as as] (http://localhost:5000/dart_sdk.js:5351:17)
at Function.as (http://localhost:5000/dart_sdk.js:46170:19)
at Function.value (http://localhost:5000/dart_sdk.js:34888:68)
at Object.findSystemLocale (http://localhost:5000/packages/intl/intl_standalone.dart.lib.js:23:35)
at main (http://localhost:5000/packages/tus_vecinos/main.dart.lib.js:568:29)
at main.throw (<anonymous>)
at http://localhost:5000/dart_sdk.js:40576:38
at _RootZone.runBinary (http://localhost:5000/dart_sdk.js:40445:59)
at _FutureListener.thenAwait.handleError (http://localhost:5000/dart_sdk.js:35374:33)
at handleError (http://localhost:5000/dart_sdk.js:35947:51)
at Function._propagateToListeners (http://localhost:5000/dart_sdk.js:35973:17)
at _Future.new.[_completeWithValue] (http://localhost:5000/dart_sdk.js:35817:23)
at async._AsyncCallbackEntry.new.callback (http://localhost:5000/dart_sdk.js:35838:35)
at Object._microtaskLoop (http://localhost:5000/dart_sdk.js:40708:13)
at _startMicrotaskLoop (http://localhost:5000/dart_sdk.js:40714:13)
at http://localhost:5000/dart_sdk.js:36191:9
  • Do you have a stack trace for this error? – Majid Mar 05 '22 at 15:31
  • Hi, thanks, I have updated the question with the stack trace. I am not able to find any sense on it (and following the links leads to nothing) – enriqueanaemma garcia cardenas Mar 05 '22 at 15:53
  • This might give you some clue `at Object.findSystemLocale ` do you have localization or intl? are you setting the default via Browser? – Majid Mar 05 '22 at 15:56
  • Yes, I have localization. And... Not sure about the default. It is in English but if system (ios or Android) is in another lenguaje, then app switch automatically. Should I research in my locale implementation? – enriqueanaemma garcia cardenas Mar 05 '22 at 16:02
  • This might give you a clue, https://github.com/dart-lang/intl/issues/164, I believe you have to set systemlocal for browser in order to avoid Null as the default language. – Majid Mar 05 '22 at 16:06

0 Answers0