Dockerized build fails when extending plugin

System Information
  • Strapi Version: 3.4.1
  • Operating System: macOS 11.1 / Linux
  • Database: MySQL
  • Node Version: 14
  • NPM Version: 6.14.4
  • Yarn Version: 1.22.5 (we use yarn)

Hi. We’ve extended the GraphQL plug-in temporarily through extensions/ for internal reasons. This all works fine until we try to containerize our app and fire up a Docker instance. Then we get module 'dataloader' not found .

On our workstations, we notice dataloader is present in both node_modules and in node_modules/strapi-plugin-graphql/node_modules , while as part of the container, it’s not present in node_modules, only in the plugin.

Any idea what’s going on?

FWIW:

The problem didn’t arise until we added the extension (which holds no package.json)

The problem goes away if we change yarn install in our Dockerfile to yarn install --production=false.

The problem also goes away if we change:
const DataLoader = require('dataloader');
to:
const DataLoader = require('strapi-plugin-graphql/node_modules/dataloader');
… in our extension.