"_debugCurrentBuildTarget == context is not true" on page reload - flutter

I get the below error whenever I refresh a page in my flutter web project
_debugCurrentBuildTarget == context is not true
at Object.throw_ [as throw] (errors.dart:216)
at Object.assertFailed (errors.dart:26)
at framework.dart:2611
at framework.BuildOwner.new.buildScope (framework.dart:2614)
at RenderObjectToWidgetAdapter.new.attachToRenderTree (binding.dart:1044)
at binding$5.WidgetsFlutterBinding.new.attachRootWidget (binding.dart:924)
at binding.dart:906
at internalCallback (isolate_helper.dart:50)

Finally, I got it fixed!!! I'm using cloud_firestore in my app, the userId I was trying to access in my widget tree was not yet available at the time of render. I figured this out by wrapping the root widget return statement in a trycatch block, as soon as I did this, The error stopped since its being handled and I printed the error to the console, then I returned a progress loader in the catch block.

Related

how do i fix Bad state error: Source maps are not done loading

i am getting this error when debugging in web flutter:
Bad state: Source maps are not done loading.
at Object.j3 (http://localhost:62170/stack_trace_mapper.js:244:69)
at jT (http://localhost:62170/stack_trace_mapper.js:2641:10)
at http://localhost:62170/stack_trace_mapper.js:2635:42
at dart._StackTrace.new.toString (http://localhost:62170/dart_sdk.js:7956:19)
at Object.str (http://localhost:62170/dart_sdk.js:5654:32)
when running to line:
final Iterable frames = filter('${FlutterError.demangleStackTrace(stack)}'.trimRight().split('\n'));
after the deployment everything seems to work correctly, I also checked the consol and there are no errors.

How to Troubleshoot Dexie bound on IDBKeyRange Error

I'm using Dexie.js version 3.0.3-rc.3 in a Vue JS project and I occasionally run into this exception in Chrome (86):
Failed to execute 'bound' on 'IDBKeyRange': The parameter is not a valid key.↵ DataError: Failed to execute 'bound' on 'IDBKeyRange': The parameter is not a valid key.
Here's a screenshot of the full error:
I'm fairly certain the problem lies with something in my data being undefined, but I'm trying to find a good way to troubleshoot this. I paused the Chrome dev tools on exceptions and inspected the code around this particular part of Dexie, but it doesn't reveal what data was used to make this exception occur.
Does anyone have any suggestions on how to find out what's actually wrong? It feels a bit like a needle in a haystack.
== Update ==
Below is the full call stack:
Try inspecting the call stack. I know it can be long until you reach a frame within your application code, but the failing call should be there!

Provider/ChangeNotifier: Set state after Widget is build

Im using the Provider/ChangenNotifier Pattern to handle state as described in the official docs.
I have a state field which I want to set after a Widget is build. However if I try to set in in the build method. I get an Error:
setState() or markNeedsBuild() called during build.
Where can I call something like:
var state = Provider.of<StateModel>(context);
state.field = 'new Val';
You can not set the state during a build, if you want to test a change of state, put this code state.field = 'new Val'; inside a button event, like FloatActionButton or a event after build completed (with Future.delayed or add post fram callback, see Is there any callback to tell me when "build" function is done in Flutter?)
Warning If you are invoking notifyListeners() inside your state.field set, and listening changes in your widget with provider, It would cause an infinite cycle of rebuild... this is another reason that you can not set state during build...

GWT Error Popup

The error popup with the following error message comes on the screen repeatedly when application is in idle state (no user activity is performed).
Error occurred on client: (TypeError): Unable to get property 'iterator_0' of undefined or null reference.
number: -2146823281
at handleEvent_206....EF34544...cache.html
at dispatchEvent_0..EF34544...cache.html
at sucess_184 ..
..
Can anyone give some pointers to navigate to the problamatic area in the code?
The fact that you're getting it repeatedly is probably due to the fact that you're performing an action on a timer (i.e. perform repeatedly an action).
From the small snippet you've shown, I don't think there's anything we can deduce. Do you have a larger stacktrace? It is still possible the error is in your own code (trying to invoke iterator() on a null object).

angular2 animation error while a prior animation is in progress: ERROR TypeError: Cannot read property 'hasOwnProperty' of undefined

i'm incurring:
ERROR TypeError: Cannot read property 'hasOwnProperty' of undefined
at http://0.0.0.0:4200/vendor.bundle.js:34007:40
at Array.forEach (native)
at WebAnimationsPlayer.init (http://0.0.0.0:4200/vendor.bundle.js:34006:32)
at InjectableAnimationEngine.DomAnimationEngine._queuePlayer (http://0.0.0.0:4200/vendor.bundle.js:33317:16)
at InjectableAnimationEngine.DomAnimationEngine.animateTransition (http://0.0.0.0:4200/vendor.bundle.js:33232:14)
at InjectableAnimationEngine.DomAnimationEngine.setProperty (http://0.0.0.0:4200/vendor.bundle.js:33103:18)
at AnimationRenderer.setProperty (http://0.0.0.0:4200/vendor.bundle.js:66773:26)
at DebugRenderer2.setProperty (http://0.0.0.0:4200/vendor.bundle.js:13520:23)
at setElementProperty (http://0.0.0.0:4200/vendor.bundle.js:9797:19)
at checkAndUpdateElementValue (http://0.0.0.0:4200/vendor.bundle.js:9716:13)
at checkAndUpdateElementInline (http://0.0.0.0:4200/vendor.bundle.js:9650:24)
at checkAndUpdateNodeInline (http://0.0.0.0:4200/vendor.bundle.js:12341:23)
at checkAndUpdateNode (http://0.0.0.0:4200/vendor.bundle.js:12316:16)
at debugCheckAndUpdateNode (http://0.0.0.0:4200/vendor.bundle.js:12945:59)
at debugCheckRenderNodeFn (http://0.0.0.0:4200/vendor.bundle.js:12924:13)
after a second animation is invoked while a prior animation is still in progress using #angular/animations 4.0.2. if i let the first animation finish, the above error does not happen. how should i go about debugging this?
this was working in #angular 2.0.
EDIT: this seems to be this issue https://github.com/angular/angular/issues/16470