[英]Cannot find module @restart/context/forwardRef during npm build
我最近在升級到較新版本的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
降級到yarn add @restart/context@2.1.2
。
長期修復是等待react-bootstrap
修復它們的導入或將它們的package.json
鎖定到這個版本的@restart/context
。
編輯:我在react-bootstrap
庫中添加了一個問題以在此處跟蹤進度: https : //github.com/react-bootstrap/react-bootstrap/issues/3576
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.