Error: "schwifty" is not a method on the passed server.
khaitranhq opened this issue · comments
Khai Tran commented
Step to reproduce
$ npx hpal ~/tiki_clone/tiki_test
$ cd ~/tiki_clone/tiki_test
$ npm i
$ npx hpal make model Category
$ npm i knex objection schwifty
$ npm start
Error:
Error: "schwifty" is not a method on the passed server.
at new module.exports (/home/leo/tiki_clone/tiki_test/node_modules/haute/node_modules/@hapi/hoek/lib/error.js:23:19)
at Object.module.exports [as assert] (/home/leo/tiki_clone/tiki_test/node_modules/haute/node_modules/@hapi/hoek/lib/assert.js:20:11)
at makeCall (/home/leo/tiki_clone/tiki_test/node_modules/haute/lib/index.js:172:14)
at Object.exports.run (/home/leo/tiki_clone/tiki_test/node_modules/haute/lib/index.js:178:15)
at /home/leo/tiki_clone/tiki_test/node_modules/haute-couture/lib/index.js:33:28
at Object.register (/home/leo/tiki_clone/tiki_test/lib/index.js:12:35)
at internals.Server.register (/home/leo/tiki_clone/tiki_test/node_modules/@hapi/hapi/lib/server.js:500:35)
at Object.exports.compose (/home/leo/tiki_clone/tiki_test/node_modules/@hapi/glue/lib/index.js:46:22)
at Object.exports.deployment (/home/leo/tiki_clone/tiki_test/server/index.js:9:31)
at Object.<anonymous> (/home/leo/tiki_clone/tiki_test/server/index.js:26:13)
package.json
"dependencies": {
"@hapi/boom": "9.x.x",
"haute-couture": "3.x.x",
"joi": "17.x.x",
"knex": "^0.21.15",
"objection": "^2.2.6"
},
"devDependencies": {
"@hapi/code": "8.x.x",
"@hapi/eslint-config-hapi": "13.x.x",
"@hapi/eslint-plugin-hapi": "4.x.x",
"@hapi/glue": "8.x.x",
"@hapi/hapi": "20.x.x",
"@hapi/lab": "23.x.x",
"babel-eslint": "10.x.x",
"confidence": "4.x.x",
"dotenv": "8.x.x",
"eslint": "7.x.x",
"hpal": "2.x.x",
"hpal-debug": "1.x.x",
"schwifty": "^5.4.1",
"toys": "2.x.x"
}
I have searched about this issue but no answer discusses that.
Thanks in advance!
devin ivy commented
You'll want to ensure the schwifty plugin is registered to the server before you start adding models. If you're following along the pal getting started tutorial, this is the file that ensures that happens: https://github.com/hapipal/examples/blob/master/paldo-riddles/lib/plugins/schwifty.js
Khai Tran commented
Thank you so much for the speedy reply