Shiny is definately working, I am changing the file from an R Markdown file to a regular R file running shiny because I think running Flexdashboard with Shiny in an R Markdown file has its limits

Has anyone experienced the "Not Found" error usin the shiny package in R?

I keep seeing 'Not Found' when trying to load my Shiny application, it seems to be that R cannot find the Shiny server, I have tried reinstalling all packages and still no luck.

The strange thing is that it works the first time I open R Studio, then it doesn't hereafter..

I have attatched a working example and a screenshot for insight.

---
title: "Benchmarking Algorithms for Credit Card Fraud Detection"
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: fill
    social: ["menu"]
    runtime: shiny
    #options: (shiny.maxRequestSize = 1500*1024^2)
---
```{r setup, include=FALSE}
suppressPackageStartupMessages({
library(shiny)
library(flexdashboard)
library(datasets)
library(caTools)
library(hydroGOF)
})

```

Column {.tabset}
-------------------------------------

### Linear Regression Model

```{r}
ui <- fluidPage(

  titlePanel("Upload Transaction Data Set"),

  sidebarLayout(

    sidebarPanel(

      fileInput("file1", "Choose CSV File",
                multiple = FALSE,
                accept = c("text/csv",
                           "text/comma-separated-values,text/plain",
                           ".csv")),

      p("The transaction data file must contain a 'Class' column that specifies the number 1 for fraudulent transactions, and 0 otherwise"),

      p("The 'Actual' graph exhibits the real calculations of the uploaded data, and the 'predicted' graph exhibits the predicted 'Class' column based on the other features of data included in your upload.")

    ),

    mainPanel(
    h1("Models"),
    plotOutput("actual"),
    plotOutput("prediction"),
    h1("Root Mean Square Error (RMSE) Accuracy %"),
    verbatimTextOutput("accuracy"),
    h1("Summary"),
    verbatimTextOutput("summary")

    )
  )
)

server = function(input,output){
  options(shiny.maxRequestSize=500*1024^2)
  thedata = reactive({
  req(input$file1)
  read.csv(file = input$file1$datapath)
  })

   output$prediction = renderPlot({
   req(thedata())

   set.seed(2)

   #Split data
   split <- sample.split(thedata(), SplitRatio=0.7)
   thedata <- subset(thedata(), split=TRUE)
   actual <- subset(thedata(), split=FALSE)

   #Create the model
    model <- lm(Class ~.,data = thedata())

   #Prediction
   prediction ...