I ran the following code by using a Jenkins pipeline, but I always get an error. What am I missing?
node {
   stage 'test'
   def whatThe = someFunc('textToFunc')
   {def whatThe2 = someFunc2('textToFunc2')}
}
def someFunc(String text){
    echo text
    text
}
def someFunc2(String text2){
    echo text2
    text2
}
Error:
java.lang.NoSuchMethodError: **No such DSL method 'someFunc'**