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

Astro update check breaks astro dev if offline #11150

Closed
alexanderniebuhr opened this issue May 26, 2024 · 2 comments
Closed

Astro update check breaks astro dev if offline #11150

alexanderniebuhr opened this issue May 26, 2024 · 2 comments
Assignees
Labels
needs triage Issue needs to be triaged

Comments

@alexanderniebuhr
Copy link
Member

Astro Info

Astro                    v4.8.2
Node                     v20.13.1
System                   macOS (arm64)
Package Manager          pnpm
Output                   hybrid
Adapter                  @astrojs/cloudflare
Integrations             @astrojs/starlight

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

No response

Describe the Bug

Discovered this during my flight, where I had no internet


> astro-tips@0.0.1 dev /Users/alexanderniebuhr/Developer/Projects/astrolicious/astro-tips
> astro dev

15:50:42 [WARN] [@astrojs/cloudflare] The current configuration does not support image optimization. To allow your project to build with the original, unoptimized images, the image service has been automatically switched to the 'noop' option. See https://docs.astro.build/en/reference/configuration-reference/#imageservice
15:50:42 [vite] Re-optimizing dependencies because lockfile has changed

 astro  v4.8.2 ready in 939 ms

┃ Local    http://localhost:4321/
┃ Network  use --host to expose

15:50:42 watching for file changes...
/Users/alexanderniebuhr/Developer/Projects/astrolicious/astro-tips/node_modules/.pnpm/wrangler@3.53.1_@cloudflare+workers-types@4.20240502.0/node_modules/wrangler/wrangler-dist/cli.js:29573
            throw a;
            ^

TypeError: fetch failed
    at node:internal/deps/undici/undici:12502:13
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async fetchPackageJson (file:///Users/alexanderniebuhr/Developer/Projects/astrolicious/astro-tips/node_modules/.pnpm/astro@4.8.2_@types+node@20.12.8_typescript@5.4.5/node_modules/astro/dist/cli/install-package.js:156:15)
    at async fetchLatestAstroVersion (file:///Users/alexanderniebuhr/Developer/Projects/astrolicious/astro-tips/node_modules/.pnpm/astro@4.8.2_@types+node@20.12.8_typescript@5.4.5/node_modules/astro/dist/core/dev/update-check.js:10:23)
    at async file:///Users/alexanderniebuhr/Developer/Projects/astrolicious/astro-tips/node_modules/.pnpm/astro@4.8.2_@types+node@20.12.8_typescript@5.4.5/node_modules/astro/dist/core/dev/dev.js:28:27 {
  [cause]: Error: getaddrinfo ENOTFOUND registry.npmjs.org
      at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:120:26) {
    errno: -3008,
    code: 'ENOTFOUND',
    syscall: 'getaddrinfo',
    hostname: 'registry.npmjs.org'
  }
}

Node.js v20.13.1
 ELIFECYCLE  Command failed with exit code 7.
 ```

### What's the expected result?

`astro dev` should still work when offline, the update check should fail silently.

### Link to Minimal Reproducible Example

https://github.com/astrolicious/astro-tips.dev

### Participation

- [ ] I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label May 26, 2024
@alexanderniebuhr
Copy link
Member Author

Once I ran it after I was online, it doesn't fail on being offline. I remember someone saying it will only warn every X runs and not on every run. Maybe that factors into the case when it fails 🤔

@Princesseuh Princesseuh self-assigned this May 27, 2024
@Princesseuh
Copy link
Member

This was fixed already!

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

No branches or pull requests

2 participants