Comments (2)
Adding a KiwiError instead of throwing assert errors. This way it is clear for the developer what is causing the issue. In this case a KiwiError indicates there is something with the kiwi package. By adding more information about the crash and some common solutions it should be clear for the developer what the problem is.
flutter: ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
flutter: The following KiwiError was thrown building ResolveError(dirty):
flutter: KiwiError:
flutter:
flutter:
flutter: Failed to resolve `String`:
flutter:
flutter: The type `String` was not registered
flutter:
flutter: Make sure `String` is added to your KiwiContainer and rerun build_runner build
flutter: (If you are using the kiwi_generator)
flutter:
flutter: When using Flutter, most of the time a hot restart is required to setup the KiwiContainer again.
flutter:
flutter: The relevant error-causing widget was:
flutter: ResolveError
flutter: file:///Users/vanlooverenkoen/Documents/projects/kiwi/flutter_example/lib/main.dart:63:13
flutter:
flutter: When the exception was thrown, this was the stack:
flutter: #0 KiwiContainer.resolve (package:kiwi/src/kiwi_container.dart:95:7)
flutter: #1 ResolveError.build (package:flutter_example/resolve_error_widget.dart:7:21)
flutter: #2 StatelessElement.build (package:flutter/src/widgets/framework.dart:4576:28)
flutter: #3 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4502:15)
flutter: #4 Element.rebuild (package:flutter/src/widgets/framework.dart:4218:5)
flutter: #5 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4481:5)
flutter: #6 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4476:5)
flutter: ... Normal element mounting (33 frames)
flutter: #39 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3446:14)
flutter: #40 Element.updateChild (package:flutter/src/widgets/framework.dart:3214:18)
flutter: #41 SliverMultiBoxAdaptorElement.updateChild (package:flutter/src/widgets/sliver.dart:1162:36)
flutter: #42 SliverMultiBoxAdaptorElement.createChild.<anonymous closure> (package:flutter/src/widgets/sliver.dart:1147:20)
flutter: #43 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2607:19)
flutter: #44 SliverMultiBoxAdaptorElement.createChild (package:flutter/src/widgets/sliver.dart:1140:11)
flutter: #45 RenderSliverMultiBoxAdaptor._createOrObtainChild.<anonymous closure> (package:flutter/src/rendering/sliver_multi_box_adaptor.dart:354:23)
flutter: #46 RenderObject.invokeLayoutCallback.<anonymous closure> (package:flutter/src/rendering/object.dart:1866:58)
flutter: #47 PipelineOwner._enableMutationsToDirtySubtrees (package:flutter/src/rendering/object.dart:918:15)
flutter: #48 RenderObject.invokeLayoutCallback (package:flutter/src/rendering/object.dart:1866:13)
flutter: #49 RenderSliverMultiBoxAdaptor._createOrObtainChild (package:flutter/src/rendering/sliver_multi_box_adaptor.dart:343:5)
flutter: #50 RenderSliverMultiBoxAdaptor.insertAndLayoutChild (package:flutter/src/rendering/sliver_multi_box_adaptor.dart:489:5)
flutter: #51 RenderSliverList.performLayout.advance (package:flutter/src/rendering/sliver_list.dart:219:19)
flutter: #52 RenderSliverList.performLayout (package:flutter/src/rendering/sliver_list.dart:262:19)
flutter: #53 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
flutter: #54 RenderSliverEdgeInsetsPadding.performLayout (package:flutter/src/rendering/sliver_padding.dart:135:11)
flutter: #55 RenderSliverPadding.performLayout (package:flutter/src/rendering/sliver_padding.dart:375:11)
flutter: #56 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
flutter: #57 RenderViewportBase.layoutChildSequence (package:flutter/src/rendering/viewport.dart:452:13)
flutter: #58 RenderViewport._attemptLayout (package:flutter/src/rendering/viewport.dart:1444:12)
flutter: #59 RenderViewport.performLayout (package:flutter/src/rendering/viewport.dart:1353:20)
flutter: #60 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
flutter: #61 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13)
flutter: #62 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
flutter: #63 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13)
flutter: #64 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
flutter: #65 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13)
flutter: #66 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
flutter: #67 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13)
flutter: #68 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
flutter: #69 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13)
flutter: #70 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
flutter: #71 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13)
flutter: #72 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
flutter: #73 RenderPositionedBox.performLayout (package:flutter/src/rendering/shifted_box.dart:394:13)
flutter: #74 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
flutter: #75 MultiChildLayoutDelegate.layoutChild (package:flutter/src/rendering/custom_layout.dart:171:11)
flutter: #76 _ScaffoldLayout.performLayout (package:flutter/src/material/scaffold.dart:484:7)
flutter: #77 MultiChildLayoutDelegate._callPerformLayout (package:flutter/src/rendering/custom_layout.dart:240:7)
flutter: #78 RenderCustomMultiChildLayoutBox.performLayout (package:flutter/src/rendering/custom_layout.dart:399:14)
flutter: #79 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
flutter: #80 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13)
flutter: #81 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
flutter: #82 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13)
flutter: #83 _RenderCustomClip.performLayout (package:flutter/src/rendering/proxy_box.dart:1248:11)
flutter: #84 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
flutter: #85 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13)
flutter: #86 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
flutter: #87 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13)
flutter: #88 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
flutter: #89 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13)
flutter: #90 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
flutter: #91 RenderStack.performLayout (package:flutter/src/rendering/stack.dart:556:15)
flutter: #92 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
flutter: #93 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13)
flutter: #94 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
flutter: #95 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13)
flutter: #96 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
flutter: #97 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13)
flutter: #98 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
flutter: #99 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13)
flutter: #100 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
flutter: #101 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13)
flutter: #102 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
flutter: #103 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13)
flutter: #104 RenderOffstage.performLayout (package:flutter/src/rendering/proxy_box.dart:3225:13)
flutter: #105 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
flutter: #106 _RenderTheatre.performLayout (package:flutter/src/widgets/overlay.dart:700:15)
flutter: #107 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
flutter: #108 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13)
flutter: #109 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
flutter: #110 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13)
flutter: #111 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
flutter: #112 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13)
flutter: #113 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
flutter: #114 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13)
flutter: #115 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
flutter: #116 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13)
flutter: #117 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
flutter: #118 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:111:13)
flutter: #119 RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
flutter: #120 RenderView.performLayout (package:flutter/src/rendering/view.dart:167:13)
flutter: #121 RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:1630:7)
flutter: #122 PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:887:18)
flutter: #123 RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:402:19)
flutter: #124 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:884:13)
flutter: #125 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:284:5)
flutter: #126 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1113:15)
flutter: #127 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1052:9)
flutter: #128 SchedulerBinding.scheduleWarmUpFrame.<anonymous closure> (package:flutter/src/scheduler/binding.dart:861:7)
flutter: (elided 11 frames from class _RawReceivePortImpl, class _Timer, dart:async, and dart:async-patch)
flutter:
flutter: ════════════════════════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by widgets library ═══════════════════════════════════════════════════════
The following KiwiError was thrown building ResolveError(dirty):
KiwiError:
Failed to resolve `String`:
The type `String` was not registered
Make sure `String` is added to your KiwiContainer and rerun build_runner build
(If you are using the kiwi_generator)
When using Flutter, most of the time a hot restart is required to setup the KiwiContainer again.
When the exception was thrown, this was the stack:
#0 KiwiContainer.resolve (package:kiwi/src/kiwi_container.dart:95:7)
#1 ResolveError.build (package:flutter_example/resolve_error_widget.dart:7:21)
#2 StatelessElement.build (package:flutter/src/widgets/framework.dart:4576:28)
#3 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4502:15)
#4 Element.rebuild (package:flutter/src/widgets/framework.dart:4218:5)
...
════════════════════════════════════════════════════════════════════════════════════════════════════
from kiwi.
Fixed in kiwi 1.1.0
from kiwi.
Related Issues (20)
- between kiwi and flutter_test version solving failed. issue HOT 2
- Add no response bot
- Null Safety HOT 1
- How can I create scoped container? HOT 2
- Generate custom Stateless widget and State HOT 1
- The type `Object` was not registered HOT 1
- Can I create `kiwi_generator` record for a string? HOT 7
- Use cascade operator in generated code HOT 3
- Doesn't work with build_runner 2.0.4 HOT 6
- Update analyzer ^1.7.1 to analyzer ^2.0.0 HOT 3
- Can't use try/catch with kiwi
- Class could not be registered correctly even when defaults are specified
- Code generator does not play nice with mockito HOT 1
- Kiwi injection not working in background/app killed state. HOT 4
- Allow analyzer version 4.x. HOT 1
- migrate to github actions HOT 1
- It is not generating anything HOT 1
- kiwi_generator cannot be used with newer analyzers HOT 8
- Please add docs which example is "compile-time DI" HOT 1
- Add possibility to resolve collection of types by super type
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kiwi.