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

Empty repo after init script #93

Closed
panzacoder opened this issue Feb 5, 2024 · 14 comments
Closed

Empty repo after init script #93

panzacoder opened this issue Feb 5, 2024 · 14 comments
Labels
bug Something isn't working

Comments

@panzacoder
Copy link

Description

Excited to get started playing with visionOS!

I ran npx @callstack/react-native-visionos@latest init YourApp, the output I got is below in "Stacktrace or logs"

A folder YourApp was created, but it only contains a .git directory, no other files or folders.

Steps to reproduce

run npx @callstack/react-native-visionos@latest init YourApp

React Native Version

0.73.3

Affected Platforms

Other (please specify)

Output of npx react-native info

no output because the react-native project is not being initialized.

Stacktrace or Logs

npx @callstack/react-native-visionos@latest init YourApp

               ######                ######
             ###     ####        ####     ###
            ##          ###    ###          ##
            ##             ####             ##
            ##             ####             ##
            ##           ##    ##           ##
            ##         ###      ###         ##
             ##  ########################  ##
          ######    ###            ###    ######
      ###     ##    ##              ##    ##     ###
   ###         ## ###      ####      ### ##         ###
  ##           ####      ########      ####           ##
 ##             ###     ##########     ###             ##
  ##           ####      ########      ####           ##
   ###         ## ###      ####      ### ##         ###
      ###     ##    ##              ##    ##     ###
          ######    ###            ###    ######
             ##  ########################  ##
            ##         ###      ###         ##
            ##           ##    ##           ##
            ##             ####             ##
            ##             ####             ##
            ##          ###    ###          ##
             ###     ####        ####     ###
               ######                ######


                  Welcome to React Native!
                 Learn once, write anywhere

⠼ Downloading templateerror Installing pods failed. This doesn't affect project initialization and you can safely proceed.
However, you will need to install pods manually when running iOS, follow additional steps in "Run instructions for iOS" section.

✖ Downloading template


info 💡 To enable automatic CocoaPods installation when building for iOS you can create react-native.config.js with automaticPodsInstallation field.
For more details, see https://github.com/react-native-community/cli/blob/main/docs/projects.md#projectiosautomaticpodsinstallation



  Run instructions for Android:
    • Have an Android emulator running (quickest way to get started), or a device connected.
    • cd "/Users/jshebert/Development/plfx/YourApp" && npx react-native run-android

  Run instructions for iOS:
    • cd "/Users/jshebert/Development/plfx/YourApp/ios"

    • Install Cocoapods
      • bundle install # you need to run this only once in your project.
      • bundle exec pod install
      • cd ..

    • npx react-native run-ios
    - or -
    • Open YourApp/ios/YourApp.xcodeproj in Xcode or run "xed -b ios"
    • Hit the Run button

  Run instructions for macOS:
    • See https://aka.ms/ReactNativeGuideMacOS for the latest up-to-date instructions.

Reproducer

https://github.com/panzacoder/bad-rn-visionOS/tree/main

Screenshots and Videos

Above repo is only provided to meet the repro requirement, there is nothing to share because the script fails.

Sorry if this is a basic issue, I normally use Expo and so am not sure what I'm missing here if anything.

@okwasniewski
Copy link
Member

Hey!

Can you try it out one more time? I've just tried it on my second mac and everything works flawlessly. You can also try skipping Pods installation during init.

Screenshot 2024-02-05 at 18 47 07

@okwasniewski okwasniewski added the bug Something isn't working label Feb 5, 2024
@panzacoder
Copy link
Author

Same results. I have yarn 4.0.1 installed globally, not sure if that matters, but from my experience yarn versions can be managed in the repo itself, unless there is a script dependency on it?

@panzacoder
Copy link
Author

I just tried npx @callstack/react-native-visionos@latest init YourApp --npm and that seemed to work (I got to the prompt to install cocoapods, which hadn't happened before).

It's installing now so I think the issue is with yarn.

@okwasniewski
Copy link
Member

Great, can you try out initializing a normal project with nightly version (it uses the latest CLI)? npx react-native@nightly init TestProject and if the issue persists, open a new one here: https://github.com/react-native-community/cli

We are reusing community-cli for the init script, and it looks like there might be an issue in the CLI itself.

@panzacoder
Copy link
Author

Ok, I was able to get it installed, but since it created a package-lock.json I got errors when getting to the yarn visionos step:

 yarn visionos
Internal Error: SpatialNotes@workspace:.: This package doesn't seem to be present in your lockfile; run "yarn install" to update the lockfile
    at $x.getCandidates (/Users/jshebert/.yarn/releases/yarn-4.0.1.cjs:205:8149)
    at Bd.getCandidates (/Users/jshebert/.yarn/releases/yarn-4.0.1.cjs:141:1311)
    at /Users/jshebert/.yarn/releases/yarn-4.0.1.cjs:210:8334
    at Yy (/Users/jshebert/.yarn/releases/yarn-4.0.1.cjs:140:53922)
    at xe (/Users/jshebert/.yarn/releases/yarn-4.0.1.cjs:210:8314)
    at async Promise.allSettled (index 0)
    at async Uc (/Users/jshebert/.yarn/releases/yarn-4.0.1.cjs:140:53250)
    at async /Users/jshebert/.yarn/releases/yarn-4.0.1.cjs:210:9065
    at async Qi.startProgressPromise (/Users/jshebert/.yarn/releases/yarn-4.0.1.cjs:140:137290)
    at async St.resolveEverything (/Users/jshebert/.yarn/releases/yarn-4.0.1.cjs:210:7063)

If I remove the package.lock & node_modules and run yarn to install fresh, I just get an error about the nightly being unavailable:

 yarn
➤ YN0000: · Yarn 4.0.1
➤ YN0000: ┌ Resolution step
➤ YN0082: │ @react-native/codegen@npm:0.74.0-nightly-20240131-82e9a5e4f: No candidates found
➤ YN0000: └ Completed in 2s 173ms
➤ YN0000: · Failed with errors in 2s 181ms

I'll try out the standard init as well

@panzacoder
Copy link
Author

Confirmed, same error there. I'll open another ticket.

Not sure what my workaround would be for now, so I guess I'll just put a pin in this.

@okwasniewski
Copy link
Member

Interesting, the version of codegen you have issues with is released on npm, so Im not sure why it has issues with it:

Screenshot 2024-02-05 at 19 56 41

@okwasniewski
Copy link
Member

okwasniewski commented Feb 5, 2024

Can you try to initialize the project with yarn classic?

yarn set version classic

I curious if this will work

@giovanijfc
Copy link

Can you try to initialize the project with yarn classic?

yarn set version classic

I curious if this will work

This work for me! Thanks!!!

@okwasniewski
Copy link
Member

@panzacoder Can you post the CLI issue here once you create it?

@okwasniewski
Copy link
Member

Hey @panzacoder is this still reproducible? I can't reproduce this on yarn v4

@panzacoder
Copy link
Author

@okwasniewski Sorry, I haven't been able to spend more time on this. You can close this and I will come back and reopen if I reproduce in the future.

@okwasniewski
Copy link
Member

Sounds good, if you will encounter this in the future please open an issue in CLI repo. Thanks

@szymonrybczak
Copy link

hey @panzacoder, make sure to test it out with --verbose and also when you have higher Yarn version globally installed, please make sure that in your root directory you don't have package.json because that create strange issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants