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

Check latest astro version fail cause astro render error page at first time visit. #11012

Closed
1 task done
QingXia-Ela opened this issue May 12, 2024 · 1 comment · Fixed by #11013
Closed
1 task done
Labels
needs triage Issue needs to be triaged

Comments

@QingXia-Ela
Copy link
Contributor

Astro Info

Astro                    v4.8.2
Node                     v18.18.1
System                   Windows (x64)
Package Manager          pnpm
Output                   static
Adapter                  none
Integrations             none

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

Astro cannot catch fetchLatestAstroVersion error when fetch failed, and it will create a error layout when first time fetch the page.

This bug may only appear in some country that cannot connect to npmjs.org normally.
It cannot reproduction in the stackblitz. I only can put some screenshots to show it.

The error will cause my test fail when I fetch the page first time.

Screenshots:
图片
图片

Stackblitz reproduction can follow this:

  • Modify node_modules/astro/dist/cli/install-package.js and let fetchPackageVersions always return Error.
  • Modify node_modules/astro/dist/core/dev/dev.js#L31 and made shouldCheck to true.

图片

What's the expected result?

Expect cli do nothing, keep server run normally.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-82f59z

Participation

  • I am willing to submit a pull request for this issue.
@bitsnaps
Copy link

I'm not sure if this issue is related to that one, but I'm still getting fetch failed with astrodb after following the steps in docs, here is a reproducible demo on stackblitz, here is the log for creating a new project:

❯ astro db link
✔ Link "~/bitsnaps/astro-db-demo" with Astro Studio? … yes
✔ Link with an existing project in Astro Studio? … no
✔ Create a new project in Astro Studio? … yes
fetch failed

Try to link an existing project:

❯ astro db link
✔ Link "~/bitsnaps/astro-db-demo" with Astro Studio? … yes
✔ Link with an existing project in Astro Studio? … yes
fetch failed

matthewp pushed a commit that referenced this issue May 13, 2024
…ion (#11013)

* fix: prevent error appear when check latest version fail(#11012)

* Resolve review problem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Issue needs to be triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants