Can not create service on postgres if default.json already has the connection string
See original GitHub issueSteps to reproduce
While trying out FeathersJS, i tried to create two services following the docs. The first is called x and the other y.
When I create x with
~/r/feathers-chat ❯❯❯ feathers generate service
? What kind of service is it? KnexJS
? What is the name of the service? x
? Which path should the service be registered on? /x
? Which database are you connecting to? PostgreSQL
? What is the database connection string?
postgres://user:password@localhost:5432/feathers_chat
Everything works perfectly.
When I create y
~/r/feathers-chat ❯❯❯ feathers generate service
? What kind of service is it? KnexJS
? What is the name of the service? y
? Which path should the service be registered on? /y
? Which database are you connecting to? PostgreSQL
The following error is thrown.
events.js:160
throw er; // Unhandled 'error' event
^
TypeError: Parameter "url" must be a string, not object
at Url.parse (url.js:88:11)
at Object.urlParse [as parse] (url.js:82:5)
at ConnectionGenerator._getConfiguration (/Users/user/.nvm/versions/node/v6.10.2/lib/node_modules/feathers-cli/node_modules/generator-feathers/generators/connection/index.js:46:24)
at ConnectionGenerator._writeConfiguration (/Users/user/.nvm/versions/node/v6.10.2/lib/node_modules/feathers-cli/node_modules/generator-feathers/generators/connection/index.js:103:32)
at ConnectionGenerator.writing (/Users/user/.nvm/versions/node/v6.10.2/lib/node_modules/feathers-cli/node_modules/generator-feathers/generators/connection/index.js:293:10)
at Object.<anonymous> (/Users/user/.nvm/versions/node/v6.10.2/lib/node_modules/feathers-cli/node_modules/yeoman-generator/lib/index.js:417:23)
at /Users/user/.nvm/versions/node/v6.10.2/lib/node_modules/feathers-cli/node_modules/run-async/index.js:25:25
at /Users/user/.nvm/versions/node/v6.10.2/lib/node_modules/feathers-cli/node_modules/run-async/index.js:24:19
at /Users/user/.nvm/versions/node/v6.10.2/lib/node_modules/feathers-cli/node_modules/yeoman-generator/lib/index.js:418:9
at runCallback (timers.js:666:20)
It seems that the feathersJS client crashes when there a postgres connection defined in the default.js
So if i create the connection before hand, the client crashes upon creating the first service with the same exact error.
I uninstalled feathers-cli@2.2.2 and installed version 2.1.1 and I had no more problems.
System configuration
Module versions (especially the part that’s not working): feathers-cli@2.2.2 NodeJS version: v6.10.2 Operating System: MAC OS 10.12.4
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:7 (3 by maintainers)
Top Results From Across the Web
PostgreSQL: Why psql can't connect to server? - Stack Overflow
The error states that the psql utility can't find the socket to connect to your database server. Either you don't have the database...
Read more >Documentation: 15: 8.14. JSON Types - PostgreSQL
JSON data types are for storing JSON (JavaScript Object Notation) data, as specified in RFC 7159. Such data can also be stored as...
Read more >Store and read connection string in appsettings.json
Method 1: Using the standard location To define the connection strings in appsettings. json it is important to specify it in the right...
Read more >Troubleshoot Server & Database Connection Problems
If Reporting Services or the Database Engine was installed as a named instance, the default connection string that is created during Setup will...
Read more >Configure Grafana | Grafana documentation
Defaults to: ${HOSTNAME} , which will be replaced with environment variable HOSTNAME , if that is empty or does not exist Grafana will...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, it worked just fine in the previous version. l will give it a look
So it worked in a previous version? I think this regression might be caused by https://github.com/feathersjs/generator-feathers/pull/229