'React build suddenly fails inside Docker image

This error is only happening inside a Docker image build:

TypeScript error in /app/src/index.tsx(12,10):
'Provider' cannot be used as a JSX component.
  Its instance type 'Provider<AnyAction>' is not a valid JSX element.
    The types returned by 'render()' are incompatible between these types.
      Type 'React.ReactNode' is not assignable to type 'import("/app/node_modules/@types/hoist-non-react-statics/node_modules/@types/react/index").ReactNode'.  TS2786
[![enter image description here][1]][1]

The command npm run build is failing when building the Docker image.

When this command is run locally, everything is working just fine.

Anyone an idea?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source