在 npm 构建期间找不到模块 @restart/context/forwardRef



我最近在升级到较新版本的react-bootstrap(1.0.0-beta.6(后开始遇到npm build问题。

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.

我尝试运行提供的 yarn 命令,但这不是有效的包名称。有没有人知道如何在不回到旧版本的情况下解决此问题(它不支持选项卡,这是我正在使用的东西(?

这是

@restart/context 的上游问题,它刚刚发布了一个破坏导入forwardRef的版本,如下所示:

import forwardRef from '@restart/context/forwardRef'

快速解决方法是通过运行 yarn add @restart/context@2.1.2 降级到 2.1.2。

长期解决方法是等待react-bootstrap修复其导入或将其package.json锁定到此版本的@restart/context

编辑:我在react-bootstrap存储库中添加了一个问题以在此处跟踪进度:https://github.com/react-bootstrap/react-bootstrap/issues/3576

最新更新