ruby-on-rails - 如何使用 Webpacker 在 JS 项目中使用 TypeScript 包
问题描述
最近需要添加一个TypeScript包,编译报错:
ERROR in ./app/javascript/packs/src/Chart.jsx 356:43-57
export 'ElderRaySeries' (imported as 'ElderRaySeries') was not found in 'react-financial-charts' (possible exports: defaultScaleProvider)
ERROR in ./app/javascript/packs/src/Chart.jsx 364:43-61
export 'SingleValueTooltip' (imported as 'SingleValueTooltip') was not found in 'react-financial-charts' (possible exports: defaultScaleProvider)
ERROR in ./app/javascript/packs/src/Chart.jsx 377:44-59
export 'CrossHairCursor' (imported as 'CrossHairCursor') was not found in 'react-financial-charts' (possible exports: defaultScaleProvider)
ERROR in ./app/javascript/packs/src/Chart.jsx 391:30-38
export 'withSize' (imported as 'withSize') was not found in 'react-financial-charts' (possible exports: defaultScaleProvider)
ERROR in ./app/javascript/packs/src/Chart.jsx 395:3-18
export 'withDeviceRatio' (imported as 'withDeviceRatio') was not found in 'react-financial-charts' (possible exports: defaultScaleProvider)
看起来我需要更改我的 webpack 配置以允许转换该包。
我发现很难找到这方面的任何信息,我该怎么做?
解决方案
推荐阅读
- request - 如何在 EOS 中推送交易?
- php - OAuth2 , PHP 和 Quickbooks
- java - 骆驼缓存条目信息和配置
- html - 选择名称以 CSS 中特定字符串开头的所有元素
- ionic-framework - 错误:Angular AoT 构建失败。看上面的问题
- bazel - Bazel 通过一次调用构建多个目标架构?
- javascript - websocket.close() 函数继续运行后
- spring-integration - 在所有分区返回之前发生超时
- python-3.x - 在python中一次转换/更改所有变量
- php - 在迁移 Symfony 中获取内核