I recently started having a problem with npm build
after upgrading to newer version of react-bootstrap
(1.0.0-beta.6
).
Creating an optimized production build...
Failed to compile.
Cannot find module: '@restart/context/forwardRef'. Make sure this package is installed.
./node_modules/react-bootstrap/es/ThemeProvider.js
You can install this package by running: yarn add @restart/context/forwardRef.
I tried running the provided yarn
command but this is not a valid package name. Does anyone have an idea how to fix this without going back to the old version (which does not support tabs, which is something I am using)?
This is an upstream issue with @restart/context, which just released a version that breaks importing
forwardRef
like this:Quick fix is to downgrade to 2.1.2 by running
yarn add @restart/context@2.1.2
.Longer term fix is to wait for
react-bootstrap
to either fix their imports or lock theirpackage.json
to this version of@restart/context
.Edit: I added an issue to the
react-bootstrap
repo to track progress here: https://github.com/react-bootstrap/react-bootstrap/issues/3576