
The following code is taken from Gonzalo Medina' answer here (click). At the time he posted the answer the code was compilable.
\documentclass{beamer}
\usepackage{pstricks-add}
\usepackage[active,tightpage]{preview}
\PreviewBorder=0pt
\PreviewEnvironment{pspicture}
\begin{document}
\begin{frame}
\begin{pspicture}(6,6)
\pnode(0,0){A}
\pnode(6,0){B}
\pnode(6,6){C}
\pnode(0,6){D}
\pnode(1,1){P}
\pnode(5,1){Q}
\pnode(3,5){R}
\only<5>{\psclip{\pscircle[linestyle=none,dimen=middle](3,3){3}}}
\only<1->{\pspolygon*[linecolor=red](A)(B)(Q)(P)}
\only<2->{\pspolygon*[linecolor=green](B)(C)(R)(Q)}
\only<3->{\pspolygon*[linecolor=blue](C)(D)(R)}
\only<4->{\pspolygon*[linecolor=yellow](D)(A)(P)(R)}
\only<5>{\endpsclip}
\end{pspicture}
\end{frame}
\end{document}

But now, the same code is no longer compilable with error /typecheck in --div--.
Actually, I want to compile the following code but the same error also occurs. What is wrong?
\documentclass{beamer}
\usepackage{pstricks}
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{pspicture}
\PreviewBorder=12pt\relax
\begin{document}
\begin{frame}{Test}
\psset{unit=.5cm,runit=.5cm}
\begin{pspicture}[showgrid=top](-7.5,-7.5)(7.5,7.5)
\pstVerb
{
%true setglobal
%globaldict begin
/c40 {40 cos} bind def
/s40 {40 sin} bind def
/s65 {6 5 s40 mul add} bind def
%end
%false setglobal
}
\pscircle[linecolor=blue]{8}
\pscustom[fillstyle=solid,fillcolor=black!20]{%
\only<1->{\psarc(0,0){5}{40}{! 180 0.3 ATAN1 sub }}
\only<2->{\psline(! 37.5 c40 mul s65 div 1.5)(! 32.5 c40 mul s65 div 0.5)}
\only<3->{\psarc(0,0){5}{!180 0.1 ATAN1 sub}{!180 0.1 ATAN1 add}}
\only<4->{\psline(! 27.5 c40 mul s65 div -0.5)(! 22.5 c40 mul s65 div -1.5)}
\only<5->{\psarc(0,0){5}{!180 0.3 ATAN1 add}{320}}
\only<6->{\psarcn(0,0){6}{! 270 5 c40 mul 36 25 c40 dup mul mul sub sqrt div ATAN1 add }{! 270 0.25 Acos sub }}
\only<7->{\psline(-7.5,-1.5)(!5 c40 mul s65 div 7.5 sub -0.5)}
\only<8->{\psarcn(0,0){6}{!180 1 12 atan add}{!180 1 12 atan sub}}
\only<9->{\psline(-7.5,0.5)(! 5 c40 mul s65 div 7.5 sub 1.5)}
\only<10->{\psarcn(0,0){6}{!180 1.5 6 atan sub}{! 1 c40 div 10 div 36 25 10 sin mul sub 60 s40 mul add mul s65 div ATAN1}}
\only<11->{\closepath}
}
\end{pspicture}
\end{frame}
\end{document}
Forensic trace record
The last success of compiling the code was on July 29, 2012 and the last update of preview is in 2010. So preview can be removed from the list of candidates causing this problem. pstricks and beamer are left, but which one is the source of problem?

avariable causing the--div--error also appeared. – Adam B. Jul 24 '14 at 07:52