Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yarn ios doesn't launch expo server, leading to unhandled exception #19

Open
zkhalapyan opened this issue Oct 28, 2021 · 3 comments
Open

Comments

@zkhalapyan
Copy link

zkhalapyan commented Oct 28, 2021

  • I'm submitting a ...
    [X ] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository
    [] question about how to use this project

  • Summary
    Running on sim, so if the expo server is up and running localhost:8081 should resolve.

Updates:

  • Looking at package.json, we can see what yarn ios is calling: "ios": "react-native run-ios", . AFAIK this assumes that expo server is already running?
  • At the same time, we know the project is an Expo project; so technically, we should be able to use expo start and use the QR code to open it in Expo Go. Nope... this leads towards a blank screen 😡
  • *Well, there is also expo run:ios that should launch the iOS app directly. Nope, this leads to the same issue.

simulator_screenshot_89D25DF0-D327-4F60-A383-99FEC9DD15D0

@cawfree
Copy link
Owner

cawfree commented Oct 28, 2021

When it refers to JSON RPC, it is failing to connect to a local hardhat node which is running a simulated local blockchain. It should get started by this line in your scripts/ios.ts file. This doesn't assume the server is running;expo run:ios will attempt to run one.

The warning you're seeing seems to indicate that although the application has bundled successfully, it is struggling to connect to the simulated blockchain where the example contracts will be deployed. This could be happening is because you're invoking the application directly as opposed to going through scripts/ios.

Can you please provide your console output? There might be an indication there that some tasks haven't initialized correctly.

@zkhalapyan
Copy link
Author

Here is the output for yarn ios:

➜  Sei git:(master) yarn ios
yarn run v1.22.17
$ react-native run-ios
warn Package eslint-plugin-functional has been ignored because it contains invalid configuration. Reason: Package subpath './package.json' is not defined by "exports" in /Users/zkhalapyan/Desktop/Sei/node_modules/eslint-plugin-functional/package.json
warn Package chai has been ignored because it contains invalid configuration. Reason: Package subpath './package.json' is not defined by "exports" in /Users/zkhalapyan/Desktop/Sei/node_modules/chai/package.json
info Found Xcode workspace "Sei.xcworkspace"
info Launching iPhone 11 (iOS 15.0)
info Building (using "xcodebuild -workspace Sei.xcworkspace -configuration Debug -scheme Sei -destination id=8573B314-7A0B-4F9A-ADFB-42CEE0F89B56")
⠧ Building the app....^C
➜  Sei git:(master) yarn ios
yarn run v1.22.17
$ react-native run-ios
warn Package eslint-plugin-functional has been ignored because it contains invalid configuration. Reason: Package subpath './package.json' is not defined by "exports" in /Users/zkhalapyan/Desktop/Sei/node_modules/eslint-plugin-functional/package.json
warn Package chai has been ignored because it contains invalid configuration. Reason: Package subpath './package.json' is not defined by "exports" in /Users/zkhalapyan/Desktop/Sei/node_modules/chai/package.json
info Found Xcode workspace "Sei.xcworkspace"
info Building (using "xcodebuild -workspace Sei.xcworkspace -configuration Debug -scheme Sei -destination id=8573B314-7A0B-4F9A-ADFB-42CEE0F89B56")
success Successfully built the app
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device }
{ platform:iOS Simulator, id:3F5951DD-E1BC-4433-B6BD-F6D3FAA12444, OS:15.0, name:iPhone 8 }
{ platform:iOS Simulator, id:02292AF0-FECB-4351-9AD5-F6BD721EBE5F, OS:15.0, name:iPhone 8 Plus }
{ platform:iOS Simulator, id:8573B314-7A0B-4F9A-ADFB-42CEE0F89B56, OS:15.0, name:iPhone 11 }
{ platform:iOS Simulator, id:50D4D060-2145-437B-8B4A-928438D96A5A, OS:15.0, name:iPhone 11 Pro }
{ platform:iOS Simulator, id:A3E85007-D7C8-43E6-8AC0-551AC5B819A4, OS:15.0, name:iPhone 11 Pro Max }
{ platform:iOS Simulator, id:6A994685-7E17-4654-8384-F8C4FE693F2A, OS:15.0, name:iPhone 12 }
{ platform:iOS Simulator, id:A188A253-8838-4E2B-9CBA-628C928052DE, OS:15.0, name:iPhone 12 Pro }
{ platform:iOS Simulator, id:EEC870D7-2024-4BF0-B910-8515B8537C61, OS:15.0, name:iPhone 12 Pro Max }
{ platform:iOS Simulator, id:EAB53EBF-C19B-4A39-AB4B-E7AC65E194B3, OS:15.0, name:iPhone 12 mini }
{ platform:iOS Simulator, id:4862E2B9-8F4D-4256-BC2C-9FA373ED1C15, OS:15.0, name:iPhone 13 }
{ platform:iOS Simulator, id:749A3381-47AD-4507-B024-8DE8F3A9F450, OS:15.0, name:iPhone 13 Pro }
{ platform:iOS Simulator, id:35D2C207-03B7-40FC-8CCF-A33547D8E837, OS:15.0, name:iPhone 13 Pro Max }
{ platform:iOS Simulator, id:9110B023-D2A8-47B4-8324-C53AB3705180, OS:15.0, name:iPhone 13 mini }
{ platform:iOS Simulator, id:02048848-A15D-47DD-A074-E90D360EA0C3, OS:15.0, name:iPhone SE (2nd generation) }
{ platform:iOS Simulator, id:957897FB-F75C-46B7-98A5-20117433602F, OS:15.0, name:iPod touch (7th generation) }
{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
{ platform:iOS Simulator, id:9A8F1D06-F2C5-49C6-886E-D2ED169E1870, OS:15.0, name:iPad (9th generation) }
{ platform:iOS Simulator, id:BE558E5A-5538-47BB-9593-4CAE1B81AA4C, OS:15.0, name:iPad Air (4th generation) }
{ platform:iOS Simulator, id:50D23A7E-6CA3-47B1-BC98-F6643EFB0BDA, OS:15.0, name:iPad Pro (9.7-inch) }
{ platform:iOS Simulator, id:9E9E2A64-28E9-4B2A-93CB-141479F49141, OS:15.0, name:iPad Pro (11-inch) (3rd generation) }
{ platform:iOS Simulator, id:534DFB4E-5F3B-4187-94F6-1A2287078A80, OS:15.0, name:iPad Pro (12.9-inch) (5th generation) }
{ platform:iOS Simulator, id:CE13F27C-028D-4E12-BABE-0B34683DE1AD, OS:15.0, name:iPad mini (6th generation) }
info Installing "/Users/zkhalapyan/Library/Developer/Xcode/DerivedData/Sei-caluecsskrfatrgeibevjqoubyep/Build/Products/Debug-iphonesimulator/sei.app"
info Launching "com.zkhalapyan.sei"
success Successfully launched the app on the simulator
✨  Done in 21.33s.

Here is the metro node output:

Last login: Fri Oct 29 11:37:55 on ttys001
/Users/zkhalapyan/Desktop/Sei/node_modules/react-native/scripts/launchPackager.command ; exit;
➜  ~ /Users/zkhalapyan/Desktop/Sei/node_modules/react-native/scripts/launchPackager.command ; exit;



















warn Package eslint-plugin-functional has been ignored because it contains invalid configuration. Reason: Package subpath './package.json' is not defined by "exports" in /Users/zkhalapyan/Desktop/Sei/node_modules/eslint-plugin-functional/package.json
warn Package chai has been ignored because it contains invalid configuration. Reason: Package subpath './package.json' is not defined by "exports" in /Users/zkhalapyan/Desktop/Sei/node_modules/chai/package.json
                                                          
               ######                ######               
             ###     ####        ####     ###             
            ##          ###    ###          ##            
            ##             ####             ##            
            ##             ####             ##            
            ##           ##    ##           ##            
            ##         ###      ###         ##            
             ##  ########################  ##             
          ######    ###            ###    ######          
      ###     ##    ##              ##    ##     ###      
   ###         ## ###      ####      ### ##         ###   
  ##           ####      ########      ####           ##  
 ##             ###     ##########     ###             ## 
  ##           ####      ########      ####           ##  
   ###         ## ###      ####      ### ##         ###   
      ###     ##    ##              ##    ##     ###      
          ######    ###            ###    ######          
             ##  ########################  ##             
            ##         ###      ###         ##            
            ##           ##    ##           ##            
            ##             ####             ##            
            ##             ####             ##            
            ##          ###    ###          ##            
             ###     ####        ####     ###             
               ######                ######               
                                                          
                 Welcome to React Native!
                Learn once, write anywhere



To reload the app press "r"
To open developer menu press "d"

[Fri Oct 29 2021 11:38:50.713]  BUNDLE  ./index.js 

[Fri Oct 29 2021 11:38:55.448]  LOG      Running "main" with {"rootTag":1,"initialProps":{}}
[Fri Oct 29 2021 11:39:06.810]  WARN     Possible Unhandled Promise Rejection (id: 0):
Error: User close QRCode Modal
@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:131605:52
@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:140567:34
forEach@[native code]
trigger@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:140562:30
@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:132477:43
_callTimer@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:30708:17
callTimers@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:30916:19
__callFunction@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:2762:36
@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:2494:31
__guard@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:2716:15
callFunctionReturnFlushedQueue@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:2493:21
callFunctionReturnFlushedQueue@[native code]

@cawfree
Copy link
Owner

cawfree commented Nov 4, 2021

Thanks for that!

This looks okay (assuming that you opened and dismissed the QRCodeModal on launch), and appears to verify that the original issue was due to the hardhat node not being launched due to a manual invocation of the app. I'll keep this issue open since it seems like it'd be useful to initialize hardhat independently of yarn ios (i.e. when launching directly via XCode).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants