Closed charlesnoble closed 7 years ago
Hi, can you post your package.json
file please? What version of Joi and Dynogels are you using?
Wow, straight on it, great work!
package.json:
"dependencies": {
"dynogels": "^5.0.2",
"joi": "^9.0.1",
},
I tried updating both Joi and Dynogels, but the same issue.
The object shown looks suspiciously like the Joi options object. Can you post an MCVE of the issue?
I can't reproduce the behavior on my end; the type works as I would expect:
> require('.').types.uuid().validate();
{ error: null, value: '1c6102e1-b896-434e-a9f1-66d7016bc732' }
I can reproduce those results too:
let test = dynogels.types.uuid().validate();
console.log(test)
Outputs:
{ error: null, value: '421ea917-c879-4d43-9d6b-ee1d72c11a22' }
I'll investigate more today and see what I can find.
Temporarily I've implemented:
import { generateUUID } from '../utils/short-hash'
var schema = {
id: Joi.string().guid().default(generateUUID),
and in short-hash.js:
import nodeUUID from 'node-uuid'
export let generateUUID = (context) => {
return nodeUUID.v4()
}
generateUUID.description = 'uuid v4'
That seems to be working. I'll try to continue debugging the other issue later tomorrow.
Can reproduce this too on my end from a new install
package.json
"dynogels": "^6.1.0",
"joi": "^9.2.0",
Any version number I can drop to for the moment?
Just started having this issue as well on a number of my services:
"dynogels": "^5.1.0",
"joi": "^9.0.4",
Looks like joi 9.2.0 gets installed. Locked it into 9.0.4 for a fix.
you're right, this seems to break the tests too.
npm i joi@9.0 && npm t
✅
npm i joi@9.1 && npm t
❌
npm i joi@9.2 && npm t
❌
I'm looking into what changed in 9.1
Thanks for your help with this, I've raised an issue asking for help from the joi
lot.
Reinstalled my node_modules folder for the first time in 17 days and suddenly dynogels.types.uuid() is not returning a UUID, but returning an Object for some strange reason.
I kept receiving the error:
and on further investigation, id looked like:
and my schema file looks like:
Not sure where this has come from and nothing else has changed and it was all previously working very well.
Thanks for the help! :+1: