Upload files in flex-directory plugin results error

I want to upload files in a flex-directory page. My entries.yaml file looks like this:

          type: file
          label: photoBody
          random_name: true
          destination: 'data/uploads'
          multiple: true

After selecting a file I get an error:

{"error":{"type":"Error","message":"Call to a member function blueprints() on null","file":"\/Users\/me\/webdevs\/my-project\/user\/plugins\/admin\/classes\/adminbasecontroller.php","line":219}}

It seems that $data = $this->view === 'pages' ? $this->admin->page(true) : $this->prepareData([]);
allways return Null.

Have I forgotten to define something?

I would be very grateful for help.