Tutorial won't compile: Meet The Composable Architecture - Testing your Feature, Testing Effects, Step 7 has an error #2271
Replies: 2 comments 5 replies
-
Hi @awolf-foreflight, a few steps before the step you highlight it was mentioned that the actions need to be made Maybe this could be improved, but it's not really an issue with the library so I am going to convert this to a discussion where we can further discuss ways to improve this. |
Beta Was this translation helpful? Give feedback.
-
Hi again @mbrandonw - I almost forgot. The reason I was back on GitHub looking at my issue was because of the following. Another example in the screenshot where the code suddenly doesn't compile. I don't understand why and now I'm stuck. I'm trying to prepare for a meeting tomorrow and now I have to switch gears and go figure out something I probably already know - I'm just not seeing the issue. Oh, I just found it. Rubber Duckie FTW! 🤓
Despite the compiler correctly describing the problem this time and having written this same bug a few times - I still didn't see it until I was writing this post. This aligns well with my previous post. Switching gears from "wrestling with TCA and trying to understand it" to debugging a random compiler error is not ideal. Worse it completely blocks further progress on the tutorial. ![]() |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
The tutorial has an error on line 14. This won't compile for me with Xcode 14.3.1 despite the store defined on line 7 being an instance of TestStore.
You can see the autocompleted doesn't provide the expected receive method. When I paste it in the code from the tutorial the test won't compile
This is a screen grab of the tutorial:
Checklist
main
branch of this package.Expected behavior
Copying and pasting code from a tutorial should compile
Actual behavior
Multiple compiler errors
This screen grab shows if you simply instantiate a test store with
TestStore()
then autocomplete works and the test compilesBut using the
store
constant doesn't work. 🤷♂️The root cause appears to be that the tutorial doesn't tell us to add the following line to the
CounterFeature.swift
file.this fixes the problem
I got lucky and got an error about Action needing to be equatable and remembered the trick the tutorial required to make
State
equatable.But this is a frustrating experience and difficult to resolve.
Steps to reproduce
Copy paste tutorial example code, try to compile, observe compiler error
The Composable Architecture version information
0.55.0
Destination operating system
ios 16.3
Xcode version information
14.3.1
Swift Compiler version information
Beta Was this translation helpful? Give feedback.
All reactions