在 npm 构建期间找不到模块 @restart/context/forwardRef [英] Cannot find module @restart/context/forwardRef during npm build
问题描述
我最近在升级到较新版本的 react-bootstrap
(1.0.0-beta.6
).
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.
我尝试运行提供的 yarn
命令,但这不是有效的包名称.有没有人知道如何在不回到旧版本的情况下解决这个问题(它不支持标签,这是我正在使用的东西)?
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)?
推荐答案
这是 的上游问题@restart/context,它刚刚发布了一个打破导入 forwardRef
的版本,如下所示:
This is an upstream issue with @restart/context, which just released a version that breaks importing forwardRef
like this:
import forwardRef from '@restart/context/forwardRef'
快速修复是通过运行 yarn add @restart/context@2.1.2
降级到 2.1.2.
Quick fix is to downgrade to 2.1.2 by running yarn add @restart/context@2.1.2
.
长期修复是等待 react-bootstrap
修复它们的导入或将它们的 package.json
锁定到此版本的 @restart/context代码>.
Longer term fix is to wait for react-bootstrap
to either fix their imports or lock their package.json
to this version of @restart/context
.
我在 react-bootstrap
存储库中添加了一个问题以在此处跟踪进度:https://github.com/react-bootstrap/react-bootstrap/issues/3576
I added an issue to the react-bootstrap
repo to track progress here: https://github.com/react-bootstrap/react-bootstrap/issues/3576
这篇关于在 npm 构建期间找不到模块 @restart/context/forwardRef的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!