expo/create-react-native-app

Something went wrong in downloading and extracting the project files.

Pointotech opened this issue · 5 comments

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):

  • OS: Ubuntu 20.04.5 LTS (Focal Fossa)

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

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.

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

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

  • yarn 1.22.19 & node 19.3.0
  • OR yarn 1.22.19 & node 16.14.2 (downgrading node)
  • OR yarn 3.4.1 & node 16.14.2 (upgrading yarn)

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...

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?

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

need fix for this on linux systems