Inject: TCA 1.7.3 crash (ComposableArchitecture/Store.swift:682: Fatal error: Unexpectedly found nil while unwrapping an Optional value)
Iβm trying to use this package with TCA 1.7.3, however when a non-leaf view is changed the app crashes. Iβve created an example project for this: InjectTCATest.
In the linked project if I change the Text("AppFeature")
in AppView
to Text("AppFeature2")
thereβs a crash:
π InjectionIII connected /Users/kuglee/Downloads/InjectTCATest/InjectTCATest.xcodeproj
π Watching files under the directory /Users/kuglee/Downloads/InjectTCATest
π Compiling /Users/kuglee/Downloads/InjectTCATest/InjectTCATest/AppFeature.swift
π Selecting Xcode /Applications/Xcode-beta.app/Contents/Developer
π Loading .dylib ...
π Interposed 15 function references.
π Injected type #1 'InjectTCATest.AppFeature'
π Injected type #2 'InjectTCATest.AppFeature.State'
π Injected type #3 'InjectTCATest.AppFeature.Action'
π Injected type #4 'InjectTCATest.AppFeature.Action.AllCasePaths'
π Injected type #5 'InjectTCATest.AppView'
ComposableArchitecture/Store.swift:682: Fatal error: Unexpectedly found nil while unwrapping an Optional value
If I change the Text("ChildFeature")
in ChildView
to Text("ChildFeature2")
it works as expected.
About this issue
- Original URL
- State: closed
- Created 5 months ago
- Comments: 19 (1 by maintainers)
Great! Yes, this one was a real time consumer but having the Feature and View in the same file is the norm for TCA so I really wanted to be sure it worked even if people have to remember to opt in with the env var for now. There will be limits and if you run up against something let me know. If you donβt, remember thereβs a tip jar on the InjectionIII project!