Closed Keryx42 closed 3 years ago
Update I stumbled over the warthog-starter repos issues and saw this issue https://github.com/goldcaddy77/warthog-starter/issues/71 regarding similar problems. I just downgraded my node version to 13 to test if it would make a difference and indeed now everything works. It's maybe not a final solution but at least a temporary work around^^°
@Keryx42 I'm glad you figured it out. I have a fix for newer versions of node - will get that in this weekend.
Node 14+ now supported: https://github.com/goldcaddy77/warthog/pull/468 . Thanks for filing the issue.
Hi first thank for creating this awesome project :) I have a question maybe it's a bug or I am doing something completely wrong. It's a fresh created project.
I tried my best formatting the informations readable ^^°
Background
{ "name": "card-api", "version": "0.0.0", "description": "Generated Warthog Project", "license": "MIT", "scripts": { "bootstrap": "yarn bootstrap:dev", "bootstrap:dev": "yarn && yarn build:dev && yarn db:drop && yarn db:create && yarn db:migrate && yarn db:seed", "bootstrap:prod": "yarn && yarn build:prod && yarn start:prod", "//": "This is the default command run in CI, so it should point to Prod and also create Prod config", "build": "yarn build:prod", "build:prod": "WARTHOG_ENV=production yarn run config && yarn compile", "build:dev": "yarn run config:dev && yarn codegen && yarn compile", "check:code": "tsc --noEmit && yarn lint && prettier ./{src,test,tools}/**/*.ts --write", "clean": "yarn db:drop && rm -rf ./node_modules ./generated ./dist", "codegen": "warthog codegen", "config": "WARTHOG_ENV=$NODE_ENV yarn dotenv:generate", "config:dev": "WARTHOG_ENV=development yarn dotenv:generate", "compile": "rm -rf ./dist && yarn tsc", "deploy": "heroku git:remote -a warthog-starter && git push heroku main && WARTHOG_ENV=production yarn dotenv:generate && warthog db:migrate", "dotenv:generate": "dotenvi -s ${WARTHOG_ENV:-development}", "db:create": "warthog db:create", "db:drop": "warthog db:drop", "db:migrate:generate": "warthog db:migrate:generate --name", "db:migrate": "warthog db:migrate", "db:seed": "ts-node tools/seed.ts", "lint": "eslint './+(src|test|tools)/**/*.{js,ts}' --fix", "list:users": "ts-node ./tools/list-users.ts", "playground": "warthog playground", "prettier": "prettier ./{src,test,tools}/**/*.ts --write", "start": "yarn start:prod", "start:dev": "ts-node-dev src/index.ts", "start:dev:watch": "nodemon -e ts,graphql -x ts-node --type-check src/index.ts", "start:prod": "WARTHOG_ENV=production yarn dotenv:generate && node dist/src/index.js", "test": "DEBUG= jest --verbose --coverage", "test:watch": "DEBUG= jest --watch" }, "husky": { "hooks": { "pre-commit": "yarn run config:dev && lint-staged && tsc -p ./tsconfig.json && yarn test" } }, "lint-staged": { "linters": { "*.ts": [ "eslint --fix", "prettier --write", "git add" ], "*.{js,json}": [ "prettier --write", "git add" ] }, "ignore": [ "**/generated/*" ] }, "dependencies": { "dotenv": "^8.2.0", "reflect-metadata": "^0.1.13", "warthog": "^2.21.0" }, "devDependencies": { "@types/jest": "^24.0.23", "dotenvi": "^0.9.0", "jest": "^24.9.0", "ts-jest": "^24.1.0", "ts-node": "^8.10", "ts-node-dev": "^1.0.0-pre.60", "typescript": "^3.9.7" }, "jest": { "globals": { "ts-jest": { "tsConfig": "tsconfig.test.json" } }, "transform": { ".ts": "ts-jest" }, "testRegex": "\\.test\\.ts$", "moduleFileExtensions": [ "js", "ts" ], "coveragePathIgnorePatterns": [ "/node_modules/", "\\.test\\.ts$" ] }, "prettier": { "printWidth": 100, "singleQuote": true } }
.env
DEBUG=1 PGUSER=postgres NODE_ENV=development WARTHOG_AUTO_OPEN_PLAYGROUND=false WARTHOG_AUTO_GENERATE_FILES=true WARTHOG_APP_HOST=localhost WARTHOG_APP_PORT=4100 WARTHOG_DB_DATABASE=card_api WARTHOG_DB_HOST=localhost WARTHOG_DB_LOGGING=all WARTHOG_DB_PASSWORD=secret WARTHOG_DB_PORT=5432 WARTHOG_DB_SYNCHRONIZE=false WARTHOG_DB_USERNAME=postgres
env.yaml
local: &local DEBUG: '*' NODE_ENV: development WARTHOG_AUTO_OPEN_PLAYGROUND: false WARTHOG_AUTO_GENERATE_FILES: false
test: PGUSER: postgres # Otherwise tries to use system user WARTHOG_DB_LOGGING: none
local_app: &local_app WARTHOG_APP_HOST: localhost WARTHOG_APP_PORT: 4100
build_env: &build_env WARTHOG_DB_ENTITIES: dist/src//*.model.js WARTHOG_DB_SUBSCRIBERS: dist/src/*/.model.js WARTHOG_RESOLVERS_PATH: dist/src//*.resolver.js
local_db: &local_db WARTHOG_DB_DATABASE: card_api WARTHOG_DB_HOST: localhost WARTHOG_DB_LOGGING: all WARTHOG_DB_PASSWORD: 'secret' WARTHOG_DB_PORT: 5432 WARTHOG_DB_SYNCHRONIZE: false WARTHOG_DB_USERNAME: postgres
prod_db: &prod_db PGSSLMODE: require WARTHOG_DB_DATABASE: ${env:WARTHOG_STARTER_DB_DATABASE} WARTHOG_DB_HOST: ${env:WARTHOG_STARTER_DB_HOST} WARTHOG_DB_LOGGING: none WARTHOG_DB_PASSWORD: ${env:WARTHOG_STARTER_DB_PASSWORD} WARTHOG_DB_PORT: ${env:WARTHOG_STARTER_DB_PORT} WARTHOG_DB_SYNCHRONIZE: false WARTHOG_DB_USERNAME: ${env:WARTHOG_STARTER_DB_USERNAME}
development: <<: local <<: local_app <<: *local_db
development:build: <<: local <<: local_app <<: build_env <<: local_db
development:prod-like: WARTHOG_APP_PROTOCOL: http <<: local <<: local_app <<: build_env <<: prod_db
production: NODE_ENV: production WARTHOG_APP_HOST: localhost WARTHOG_APP_PORT: ${env:PORT} WARTHOG_INTROSPECTION: true WARTHOG_PLAYGROUND: true <<: prod_db <<: build_env
What I did
yarn add yarn add warthog
yarn warthog new
yarn
yarn warthog generate user name
// the files where created successfullyyarn warthog codegen
// the files where generated succefullyyarn warthog db:migrate:generate --name=create-user-table
- no mirgrations where created command finish with. Output:✨ Done in 6.33s.
yarn warthog db:migrate
- does than nothing (ofc with no migrations) Output✨ Done in 5.75s.
yarn start:dev
- Generates output and than the server is not started. Output[INFO] 13:39:19 ts-node-dev ver. 1.1.6 (using ts-node ver. 9.1.1, typescript ver. 3.9.9) ✨ Done in 5.97s.
Further Information: Db connection seems to work
"clean": "yarn db:drop && rm -rf ./node_modules ./generated ./dist",
yarn
againyarn warthog db:create
- This successfully created the database again. So the db configuration seems fine for me OutputDatabase 'card_api' created! ✨ Done in 4.51s.
Further Information: doesn't seem to be a file write access problem
Further Information: A Guess from my side I read in the documentation that the Migration commands are
Thanks in advance If you need more Informations I try my best to deliver them :)