Closed dsl101 closed 1 year ago
Let me look now and see if it's the issue I suspect.
Hmm, so I wiped the simulator and tested and things seem to work fine on my end. Can you verify this is still an issue after having set up the environment?
I will go from scratch today and document fully. Did you have to log in on Memmy when you started up the simulator?
Yea I had to sign in. I was thinking maybe it was an issue with there not being an account yet, but doesn't seem to be at least on my end. If you have any issues i'll be around on Discord now (been gone for a bit) so we can discuss.
OK, here's my rundown. My build env is this:
And the command sequence I used was this:
$ git clone https://github.com/Memmy-App/memmy.git memmy_clean
$ yarn install
$ cd ios && npx pod-install && cd ..
$ npx react-native run-ios
On first run, that last command fails with this error:
2023-07-28 10:13:20.195 xcodebuild[2073:20341] DVTCoreDeviceEnabledState: DVTCoreDeviceEnabledState_Disabled set via user default (DVTEnableCoreDevice=disabled)
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution [Expo]\ Configure\ project /Users/davidl/Library/Developer/Xcode/DerivedData/Memmy-aysjeuovkbbejrdsdcedaugpkbxi/Build/Intermediates.noindex/Memmy.build/Debug-iphonesimulator/Memmy.build/Script-107810AFB63196538F89F4BB.sh (in target 'Memmy' from project 'Memmy')
(1 failure)
This appears to be caused by the blank line in ios/.xcode.env
, and removing it clears that error. On the second run, the Metro terminal window opens, and the simulator starts up at the Metro home screen:
Clicking on the localhost link builds the app in the Metro window, which errors with:
BUNDLE ./index.js
LOG Running "main" with {"rootTag":31,"initialProps":{}}
LOG [CodePush] Checking for update.
ERROR TypeError: Cannot read property 'username' of undefined
This is in Stack.tsx
in the root of the project. I put a guard in there, but the error just moved further down the chain, and as you say isn't really the solution anyway.
After investigation, this turned out to be probably an expired JWT from a lemmy.world account that was logged in on the simulator. The app should have asked for re-authentication, but didn't. Removing the app from the simulator (clearing data) and relaunching) solved this error. So, I'm closing this and opening one about the JWT instead.
Check for open issues
Minimal reproducible example
Download & build the current branch in ios Simulator. On launch, Metro logs:
There are several places in the code that reference
currentAccount.username
, but before login this is undefined and throws errors.Expected Behavior
Able to log in
Version
main branch
App Store or TestFlight?
TestFlight
iOS Version
16.x
Device
ios Simulator