“Node Stack Overflow” error while running R script on Plumber

I am trying to create a REST web API using plumber package in R.first time it runs fine but second time when we run the same code it’s showing the “node stack overflow” error. I just try to print the same message from my function. Code is given in the next section

I have also tried running it on VMWare linux (Ubuntu) by allocating it additional memory (initially 8192 kb and then 7969177 kb. However the result has always been the same error

    # plumber.R
    #' Echo the parameter that was sent in
    #' @param msg The message to echo back.
    #' @get /echo
       function(msg="")
        {
          list(msg = paste0 ("The message is: '", msg, "'"))
        }
       library('plumber')
      plumber::plumb("plumber.R")$run

Read more here: Source link