#i can't seem to import the payload validate functions.

11 messages · Page 1 of 1 (latest)

quasi bramble
ivory swiftBOT
#

Help is on the way! To mark it as solved, use the /solve command. In the meantime, here are some existing threads that may help you:

Documentation:

Community-Help:

tardy lodge
#

this issue is still present

timber hamlet
#

still present

fossil crest
#

@timber hamlet @quasi bramble @tardy lodge can you share the code you're trying to run exactly?

#

sorry this one slipped through the cracks 😬

quasi bramble
#

on my end i'm just trying to import the validate functions that payload uses.
for example calling this in the validate function:

// i want to use number
const numberError = number(val, options);

timber hamlet
#

I was trying to import { text } from 'payload/fields/validations'

fossil crest
#

thanks, will check on the export of those functions

#

yeah something is not right in there, will open an issue
in the meantime this should work if you need something sooner

import { number, text } from 'payload/dist/fields/validations'