Blitz: Blitz new dependency updates can fail, but it should not

Created on 23 Apr 2020  Â·  2Comments  Â·  Source: blitz-js/blitz

What is the problem?

If there's a network error or something that interrupts fetching the latest dependencies, the entire blitz new process fails. It should not.

  1. It should retry each request 1 time
  2. If still fails, then fallback to the template version and keep going.
  3. Also we should write tests for this whole update functionality

Versions:

blitz: 0.6.0-canary.0 (global)

Supporting Documentation

/t/mm> blitz new app

Hang tight while we set up your new Blitz app!

CREATE    .babelrc.js
CREATE    .env
CREATE    .eslintrc.js
CREATE    .npmrc
CREATE    .prettierignore
CREATE    README.md
CREATE    app/components/.keep
CREATE    app/components/ErrorBoundary.tsx
CREATE    app/layouts/.keep
CREATE    app/pages/_app.tsx
CREATE    app/pages/_document.tsx
CREATE    app/pages/index.tsx
CREATE    blitz.config.js
CREATE    db/index.ts
CREATE    db/migrations/.keep
CREATE    db/schema.prisma
CREATE    integrations/.keep
CREATE    jobs/.keep
CREATE    package.json
CREATE    public/favicon.ico
CREATE    public/logo.png
CREATE    tsconfig.json
CREATE    utils/.keep
CREATE    .gitignore

â—¢ Retrieving the freshest of dependenciesFetchError: invalid json response body at https://registry.npmjs.org/next reason: Unexpected end of JSON input
    at ~/.config/yarn/global/node_modules/node-fetch/lib/index.js:272:32
    at runMicrotasks (<anonymous>)
good first issue kinbug scopcli

Most helpful comment

Someone working on this might want to swap node-fetch for got, which has built-in support for retrying on failure. Next use this for their create-next-app cli.

All 2 comments

Someone working on this might want to swap node-fetch for got, which has built-in support for retrying on failure. Next use this for their create-next-app cli.

I'll have a go with this, considering I've already worked on blitz new :D

Was this page helpful?
0 / 5 - 0 ratings

Related issues

svobik7 picture svobik7  Â·  3Comments

aaronfulkerson picture aaronfulkerson  Â·  3Comments

simonedelmann picture simonedelmann  Â·  3Comments

ganeshmani picture ganeshmani  Â·  4Comments

flybayer picture flybayer  Â·  4Comments