The task of out-of-distribution (OOD) detection is vital to realize safe andreliable operation for real-world applications. After the failure oflikelihood-based detection in high dimensions had been shown, approaches basedon the \emph{typical set} have been attracting attention; however, they stillhave not achieved satisfactory performance. Beginning by presenting the failurecase of the typicality-based approach, we propose a new reconstructionerror-based approach that employs normalizing flow (NF). We further introduce atypicality-based penalty, and by incorporating it into the reconstruction errorin NF, we propose a new OOD detection method, penalized reconstruction error(PRE). Because the PRE detects test inputs that lie off the in-distributionmanifold, it effectively detects adversarial examples as well as OOD examples.We show the effectiveness of our method through the evaluation using naturalimage datasets, CIFAR-10, TinyImageNet, and ILSVRC2012.