graphile / livesotope Goto Github PK
View Code? Open in Web Editor NEWSimple demo of using PostGraphile live queries
Simple demo of using PostGraphile live queries
The install steps work fine until getting to the yarn dev
step.
When running it, I get errors, and the processes all close.
Follow the install instructions on Windows.
I expect the dev-server to launch without error.
I get these errors on running yarn dev
:
> yarn dev
yarn run v1.22.10
$ concurrently --kill-others --names pg,ra 'npm run postgraphile' 'npm run start' 'npm run random'
[pg] 'np' is not recognized as an internal or external command,
[pg] operable program or batch file.
[ra] 'run' is not recognized as an internal or external command,
[ra] operable program or batch file.
[2] 'postgraphile'' is not recognized as an internal or external command,
[2] operable program or batch file.
[3] 'np' is not recognized as an internal or external command,
[3] operable program or batch file.
[4] 'run' is not recognized as an internal or external command,
[4] operable program or batch file.
[5] 'start'' is not recognized as an internal or external command,
[5] operable program or batch file.
[6] 'np' is not recognized as an internal or external command,
[6] operable program or batch file.
[7] 'run' is not recognized as an internal or external command,
[7] operable program or batch file.
[7] run exited with code 1
--> Sending SIGTERM to other processes..
[6] np exited with code 1
--> Sending SIGTERM to other processes..
[5] start' exited with code 1
--> Sending SIGTERM to other processes..
[4] run exited with code 1
--> Sending SIGTERM to other processes..
[3] np exited with code 1
--> Sending SIGTERM to other processes..
[2] postgraphile' exited with code 1
--> Sending SIGTERM to other processes..
[ra] run exited with code 1
--> Sending SIGTERM to other processes..
[pg] np exited with code 1
--> Sending SIGTERM to other processes..
[8] 'random'' is not recognized as an internal or external command,
[8] operable program or batch file.
[8] random' exited with code 1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Not needed. (I know the cause)
The fix for the issue is to replace the single quotes in the "dev" command with double quotes. (The Windows command-prompt and Powershell do not recognize the single quotes as quotes, instead interpreting them as parts of commands -- you can see this from the error log, where the single-quotes are included in the postgraphile'
and start'
command names)
Once I replaced the single-quotes with double-quotes, the yarn dev
command runs successfully:
> yarn dev
yarn run v1.22.10
$ concurrently --kill-others --names pg,ra "npm run postgraphile" "npm run start" "npm run random"
[pg]
[pg] > [email protected] postgraphile C:\Root\Apps\@V\@Modules\graphile-engine\LiveQueryBug\Attempt1
[pg] > postgraphile -c livesotope -s app_public --watch --append-plugins @graphile-contrib/pg-simplify-inflector,@graphile/subscriptions-lds --live --port 9393
[pg]
[ra]
[ra] > [email protected] start C:\Root\Apps\@V\@Modules\graphile-engine\LiveQueryBug\Attempt1
[ra] > react-scripts start
[ra]
[2]
[2] > [email protected] random C:\Root\Apps\@V\@Modules\graphile-engine\LiveQueryBug\Attempt1
[2] > nodemon random.js
[2]
[2] [nodemon] 1.19.0
[2] [nodemon] to restart at any time, enter `rs`
[2] [nodemon] watching: *.*
[2] [nodemon] starting `node random.js`
[pg]
[pg] PostGraphile v4.4.0-rc.1 server listening on port 9393 �
[pg]
[pg] ‣ GraphQL API: http://localhost:9393/graphql (live subscriptions enabled)
[pg] ‣ GraphiQL GUI/IDE: http://localhost:9393/graphiql
[pg] ‣ Postgres connection: postgres:///livesotope (watching)
[pg] ‣ Postgres schema(s): app_public
[pg] ‣ Documentation: https://graphile.org/postgraphile/introduction/
[pg] ‣ Join NodeSource in supporting PostGraphile development: https://graphile.org/sponsor/
[pg]
[pg] * * *
[pg]
[ra] Starting the development server...
[ra]
[ra] Browserslist: caniuse-lite is outdated. Please run next command `yarn upgrade`
[ra] Compiled successfully!
[ra]
[ra] You can now view livesotope in the browser.
[ra]
[ra] Local: http://localhost:3000/
[ra] On Your Network: http://192.168.114.2:3000/
[ra]
[ra] Note that the development build is not optimized.
[ra] To create a production build, use yarn build.
The "pg" module used by "random.js" is outdated; it silently fails to connect on Node v14.5.0.
Run the "random.js" script, with Node v14.5.0; no errors will be shown, but code will fail to perform any update operations. (the awaited promise in random()
simply never resolves)
I expect to see the "ranking" cells in the "people" table update, from the execution of the timer in random.js
.
No database updates are performed. (confirmed by checking with pgAdmin)
OS: Windows 10
PostgreSQL: 13.1
Node: 14.5.0
I ran yarn add pg@latest
, and afterward the random.js
script began successfully updating the people
table.
I found this solution (updating the pg
module) from the following comment: brianc/node-postgres#2317 (comment)
The thread shows other people with the same issue, and some discussion on the source of the issue. (apparently due to an update to the Node stream
module)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.