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

fetch failed error in creating payload app with create-payload-app #10151

Closed
Inna-Mykytiuk opened this issue Dec 23, 2024 · 10 comments
Closed

fetch failed error in creating payload app with create-payload-app #10151

Inna-Mykytiuk opened this issue Dec 23, 2024 · 10 comments
Assignees

Comments

@Inna-Mykytiuk
Copy link

Inna-Mykytiuk commented Dec 23, 2024

Describe the Bug

Every time I want to install an app, I get this message, no matter if I use npx or pnpx

$ npx create-payload-app

┌ create-payload-app

◇ ────────────────────────────────────────────╮
│ │
│ Welcome to Payload. Let's create a project! │
│ │
├───────────────────────────────────────────────╯

◇ Project name?
│ payload

◇ Choose project template
│ blank

◇ Select a database
│ MongoDB

◇ Enter MongoDB connection string
│ mongodb://127.0.0.1/payload

■ fetch failed

or

$ npx create-payload-app

┌ create-payload-app

◇ ────────────────────────────────────────────╮
│ │
│ Welcome to Payload. Let's create a project! │
│ │
├───────────────────────────────────────────────╯

◇ Project name?
│ payload-test

◇ Choose project template
│ blank

◇ Select a database
│ MongoDB

◇ Enter MongoDB connection string
│ mongodb+srv://innkapinnka:[email protected]/

■ fetch failed

Result will be the same. Help me please.Image
Image
Image

Link to the code that reproduces this issue


Reproduction Steps

create payload application with following steps
1 pnpx create-payload-app
2. Select a database as MongoDB
3. Enter MongoDB connection string
it will breakdown with fetch failed error

Which area(s) are affected? (Select all that apply)

area: core

Environment Info

create-payload-app@
@Inna-Mykytiuk Inna-Mykytiuk added status: needs-triage Possible bug which hasn't been reproduced yet validate-reproduction labels Dec 23, 2024
Copy link
Contributor

Please add a reproduction in order for us to be able to investigate.

Depending on the quality of reproduction steps, this issue may be closed if no reproduction is provided.

Why was this issue marked with the invalid-reproduction label?

To be able to investigate, we need access to a reproduction to identify what triggered the issue. We prefer a link to a public GitHub repository created with create-payload-app@beta -t blank or a forked/branched version of this repository with tests added (more info in the reproduction-guide).

To make sure the issue is resolved as quickly as possible, please make sure that the reproduction is as minimal as possible. This means that you should remove unnecessary code, files, and dependencies that do not contribute to the issue. Ensure your reproduction does not depend on secrets, 3rd party registries, private dependencies, or any other data that cannot be made public. Avoid a reproduction including a whole monorepo (unless relevant to the issue). The easier it is to reproduce the issue, the quicker we can help.

Please test your reproduction against the latest version of Payload to make sure your issue has not already been fixed.

I added a link, why was it still marked?

Ensure the link is pointing to a codebase that is accessible (e.g. not a private repository). "example.com", "n/a", "will add later", etc. are not acceptable links -- we need to see a public codebase. See the above section for accepted links.

Useful Resources

@Inna-Mykytiuk
Copy link
Author

this issue marked with the invalid-reproduction label because I can't create new repository. I can copy your template, but I want to understand why I can't create app from scratch with terminal

@denolfe
Copy link
Member

denolfe commented Dec 23, 2024

Hey @Inna-Mykytiuk , this error is likely due to not being able to fetch the template code from the github URL. You can get more info by passing the --debug flag to the CLI.

It will give back a URL like https://codeload.github.com/payloadcms/payload/tar.gz/main.

Can you verify that you're able to reach that file in a browser? It will attempt to download the specified file.

@denolfe denolfe self-assigned this Dec 23, 2024
@github-actions github-actions bot removed the status: needs-triage Possible bug which hasn't been reproduced yet label Dec 23, 2024
@Inna-Mykytiuk
Copy link
Author

Inna-Mykytiuk commented Dec 24, 2024

No access, The connection is not confidential and is marked as potentially threatening to my system.

But I managed to upload the file. What should I do with it?

@elghaied
Copy link

hello @Inna-Mykytiuk , do you have the same issue if you try to install next js
npx create-next-app@latest

@Inna-Mykytiuk
Copy link
Author

No, I don't have problem with Next installation

@Inna-Mykytiuk
Copy link
Author

This problem with payload occurs both on the computer and on the laptop, the Windows10-11 operating system

@elghaied
Copy link

elghaied commented Dec 24, 2024

@Inna-Mykytiuk I searched a bit, most cases were because of VPN/Proxy or antivirus and firewalls

when you run this what you get

node -e "require('https').get('https://raw.githubusercontent.com/payloadcms/payload/refs/heads/main/templates/website/package.json', res => { res.setEncoding('utf8'); res.on('data', console.log); res.on('error', console.error); }).on('error', console.error);"

you can install the web template using git cli using


git clone -n --depth=1 --filter=tree:0 https://github.com/payloadcms/payload my-project && cd my-project && git sparse-checkout set --no-cone templates/website && git checkout && rm -rf .git && git init && git add . && git mv -f templates/website/{.,}* . && git add . && git commit -m "Initial commit"

@denolfe
Copy link
Member

denolfe commented Dec 25, 2024

This appears to be very specific to your networking setup. Beyond fixing that configuration, it may be easier to grab the code directly from the repository here by either cloning the repository and copying or downloading the repo via zip and copying.

Closing this as it is something to do w/ your specific setup and no others are seeing this issue.

@denolfe denolfe closed this as completed Dec 25, 2024
Copy link
Contributor

This issue has been automatically locked.
Please open a new issue if this issue persists with any additional detail.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants