Dear all,

The following example using module pgfplots does not work in an updated context standalone nor with the texlive 2019 version.

%% Workaround for using tikz version in texlive 2019.
%% See https://github.com/pgf-tikz/pgf/issues/675
%\unprotect
%\def\XC@tgt@mod#1{#1}
%\def\XC@sdef#1#2{\edef#1{#2}}
%\protect

\setupcolors[state=start]
\usemodule[pgfplots]
\starttext
\starttikzpicture
  \startaxis
    \addplot3 [
      surf,
      shader=interp, % works with shader=flat
      samples=10,
      domain=0:1,
      ] {x^2*y};
  \stopaxis
\stoptikzpicture
\stoptext

The  error is the following (where line 19 contains "\stopaxis")
lua error       > lua error on line 19 in file [...]:
...781ce0dde776fb1556f32e/formats/luatex/lpdf-ini-macro.lua:887: pdf.obj(): object "type" missing

I'm attaching the test file, with the .the log and  ...-error.log files. Please note that to reproduce the error with the context version of texlive 2019 the first lines must be uncommented due to a bug in the newer version of tikz.

I suspect that the problem is with context because same file works with context from texlive 2018 (which has the same pgfplots version) and an equivalent latex version works with lualatex.

Could you suggest any workaround? If not I'll file a bug with pgfplots.

Thank you in advance,
LD