Program fails in both rstan and CmdStanR

I’m facing trouble running the following syntactically correct program in Stan via R, trying both rstan (v. 2.21.2) and CmdStanR (v. 0.1.2).

data {
  int<lower=1> N; 
  vector<lower = 0, upper = 1>[N] intra;
  vector<lower = 0, upper = 1>[N] inter;
}
transformed parameters {
  real<lower = 0, upper = 1> gap;
  real alpha;
  real beta;
  gap = alpha * min(inter) - beta * max(intra);
}
model {
  target += normal_lpdf(alpha | mean(inter), sd(inter));
  target += normal_lpdf(beta | mean(intra), sd(intra));
}

Any ideas on what the problem could be here? rstan aborts my R session and in CmdStanR, the resulting error messages aren’t very informative, simply stating that the chains have finished unexpectedly.

Can you upgrade the cmdstanr version?
Latest Github version is 0.3.0.9000. Upgrade using

remotes::install_github("stan-dev/cmdstanr")

Then if the problem persists, run fit$output(1) when the chains finish.