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.