Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add knexfile.ts example to README.md #250

Merged
merged 1 commit into from
Jul 5, 2020
Merged

Add knexfile.ts example to README.md #250

merged 1 commit into from
Jul 5, 2020

Conversation

jhuizingh
Copy link
Contributor

This PR gives an example of how to do the knexfile.js in TypeScript. The JS version did not work for me, giving the below error. The modified example in the PR successfully worked.

Also, not directly related, I needed to run npm install -g knex before the migration generation command worked. Not sure if that would make sense to document somewhere in the readme too.

Error:

$ knex migrate:make create-users
(node:4651) UnhandledPromiseRejectionWarning: Error: Cannot find module './src/app'
Require stack:
- /home/jh/code/feathers-chat/knexfile.js
- /home/jh/.nvm/versions/node/v12.16.3/lib/node_modules/knex/bin/cli.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:957:15)
    at Function.Module._load (internal/modules/cjs/loader.js:840:27)
    at Module.require (internal/modules/cjs/loader.js:1019:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (/home/jh/code/feathers-chat/knexfile.js:1:13)
    at Module._compile (internal/modules/cjs/loader.js:1133:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
    at Module.load (internal/modules/cjs/loader.js:977:32)
    at Function.Module._load (internal/modules/cjs/loader.js:877:14)
    at Module.require (internal/modules/cjs/loader.js:1019:19)
(node:4651) 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:4651) [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.

Summary

(If you have not already please refer to the contributing guideline as described
here
)

  • Tell us about the problem your pull request is solving.
  • Are there any open issues that are related to this? No
  • Is this PR dependent on PRs in other repos? No

If so, please mention them to keep the conversations linked together.

@daffl daffl merged commit 0710f19 into feathersjs-ecosystem:master Jul 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants