grand-stack / grand-stack-starter

Simple starter project for GRANDstack full stack apps

Home Page:https://grandstack.io/docs/getting-started-grand-stack-starter.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UnhandledPromiseRejectionWarning: Error: socket hang up

naruraghavan opened this issue Β· comments

I am getting this error while creating an app using create-grand-stack-app app. Here is the full context.

❯ yarn create grandstack-app map
yarn create v1.22.5
[1/4] πŸ” Resolving packages...
[2/4] 🚚 Fetching packages...
[3/4] πŸ”— Linking dependencies...
[4/4] πŸ”¨ Building fresh packages...
success Installed "create-grandstack-app@0.4.2" with binaries:
- create-grandstack-app
? Please choose which project template to use React
? Install dependencies? Yes
? Initialize a git repository? Yes
? Now let's configure your GraphQL API to connect to Neo4j. If you don't have a Neo4j instance you can create one for free in the cloud at https://neo4j.com/sandbox

Hit When you are ready.
? Alright, Enter the connection string for Neo4j bolt://localhost:7687
? Use an encrypted connection for Neo4j? (Select "No" for Neo4j Sandbox) Yes
? Enter the Neo4j user neo4j
? Enter the password for this user
Initializing Project...
❯ Create GRANDstack App
βœ” Using directory '/Users/nvenkat/Engineering/workspace/map'
βœ– Downloading latest release
β†’ socket hang up
Extracting latest release
Creating Local env file with configuration options...
Creating scripts configuration...
Removing unused templates:
βœ” web-react-ts
βœ” web-angular
βœ” mobile_client_flutter
Initialize git
Installing Packages with yarn
(node:51491) UnhandledPromiseRejectionWarning: Error: socket hang up
at connResetException (internal/errors.js:612:14)
at Socket.socketOnEnd (_http_client.js:493:23)
at Socket.emit (events.js:326:22)
at endReadableNT (_stream_readable.js:1244:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
(Use node --trace-warnings ... to show where the warning was created)
(node:51491) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:51491) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
✨ Done in 21.14s.

I tried npx with npm option as well, but fails exactly the same way.

I get the same issue with yarn and npx. I was able to resolve by downgrading my version of node and using yarn.

@idriseabdi @naruraghavan let me know if this is still coming up for you. Unable to reproduce, I did notice referential I see a slightly different version create-grandstack-app@0.4.3 not create-grandstack-app@0.4.2 maybe this was solved in the latest release.

Tested on
macOS :: 10.15.6
Linux pop-os :: 5.4.0-7642-generic

With
yarn -v :: 1.22.5
node -v :: v14.11.0
npx/npm :: 6.14.8

yarn create grandstack-app test
success Installed "create-grandstack-app@0.4.3" with binaries:
      - create-grandstack-app
? Please choose which project template to use React
? Install dependencies? Yes
? Initialize a git repository? Yes
? Now let's configure your GraphQL API to connect to Neo4j. If you don't have a Neo4j instance you can create one for free in the cloud at https://neo4j.com
/sandbox

Hit <Return> When you are ready.
? Alright, Enter the connection string for Neo4j bolt://localhost:7687
? Use an encrypted connection for Neo4j? (Select "No" for Neo4j Sandbox) Yes
? Enter the Neo4j user neo4j
? Enter the password for this user letmein
Initializing Project...
  βœ” Create GRANDstack App
    βœ” Creating directory '/Users/contextcue/code/work/neo4j/test'
    βœ” Downloading latest release
    βœ” Extracting latest release
    βœ” Creating Local env file with configuration options...
    βœ” Creating scripts configuration...
    βœ” Removing unused templates:
       βœ” web-react-ts
       βœ” web-angular
       βœ” mobile_client_flutter
  βœ” Initialize git
  βœ” Installing Packages with yarn
    βœ” Installing GRANDstack CLI and dependencies
    βœ” Installing api dependencies
    βœ” Installing web-react dependencies

Thanks for using GRANDstack! We've created your app in '/Users/contextcue/code/work/neo4j/test'
You can find documentation at: https://grandstack.io/docs

To start your GRANDstack web application and GraphQL API run:

        cd test
        npm run start

Then (optionally) to seed the database with sample data, in the api/ directory in another terminal run:

        npm run seedDb

✨  Done in 96.11s.

npx

$ npx create-grandstack-app test --use-npm
... all the things
Thanks for using GRANDstack! We've created your app in '/Users/contextcue/code/work/neo4j/test'
... other things

I'll check in next week and close if there aren't any updates

Yes, this should have been fixed in the v.0.4.3 release of create-grandstack-app. Please give that a try and let us know if you're still seeing the error.