expo / create-react-native-app

Create React Native apps that run on iOS, Android, and web
BSD 3-Clause "New" or "Revised" License
13.26k stars 1.35k forks source link

Something went wrong in downloading and extracting the project files. #917

Open Pointotech opened 1 year ago

Pointotech commented 1 year ago

Describe the bug

When trying to create a new React-Native app, I get the generic error message "Something went wrong in downloading and extracting the project files."

To Reproduce Steps to reproduce the behavior:

  1. Run command: create-react-native-app mobile-client
  2. When asked "How would you like to start", pick "Template from expo/examples: https://github.com/expo/examples"
  3. When asked "Pick an example", pick "with-typescript"
  4. See error: "Something went wrong in downloading and extracting the project files."

Expected behavior This should create a new project.

Desktop (please complete the following information):

Smartphone (please complete the following information): Not applicable, since I can't even create a project.

mcintyre94 commented 1 year ago

Also seeing this on MacOS, tested multiple templates

$ npx create-react-native-app -t with-router test1
✖ Something went wrong in downloading and extracting the project files.
$ npx create-react-native-app -t navigation test2
✖ Something went wrong in downloading and extracting the project files.
$ npx create-react-native-app -t with-typescript test3
✖ Something went wrong in downloading and extracting the project files.
blixit commented 1 year ago

I noticed something really strange: if I run the command with --verbose option, it works out. It's not a fix but it can prevent from being stuck while a solution is found

image
blixit commented 1 year ago

After investigation, I found the exception and the line that triggers this error on my computer (MacBook Pro M1 - macOS 12.6.2) Environment:

image

In my case the error is triggered by the following function src/Example.ts::downloadAndExtractExampleAsync

When I tried to log the stream behaviour, I got this Code CLI output
Case 1 image image
Case 2 image image

According to this answer (https://stackoverflow.com/a/61379055) it seems to be an issue with the ending of the stream

this is your problem here a stream is destroyed before it ends normally, either an error or a return/break/throws in an asyncGenerator/asyncFunction

Reproductible result As you can see in the case 2 scenario, +END and +CLOSE are called before -CLOSE. I get the same output each time the Premature close error is raised

Still investigating...

Karlelco commented 1 year ago

Also seeing this on MacOS, tested multiple templates

$ npx create-react-native-app -t with-router test1
✖ Something went wrong in downloading and extracting the project files.
$ npx create-react-native-app -t navigation test2
✖ Something went wrong in downloading and extracting the project files.
$ npx create-react-native-app -t with-typescript test3
✖ Something went wrong in downloading and extracting the project files.

did you find a solution for this error?

Karlelco commented 1 year ago

✖ Something went wrong in downloading and extracting the project files.

need fix for this on linux systems