如何解释这个babel构建错误

时间:2018-02-28 17:01:34

标签: reactjs react-native babel katex

我真的不明白这种情况下的重要信息是什么。

我看到几个目录和几个文件。

...node_modules/react-native-katex/src/index.js: Unknown option: .../node_modules/react/index.js.Children. Check out http://babeljs.io/docs/usage/options/ for more information about options.

A common cause of this error is the presence of a configuration options object without the corresponding preset name. Example:

Invalid:
  `{ presets: [{option: value}] }`
Valid:
  `{ presets: [['presetName', {option: value}]] }`

For more detailed information on preset configuration, please see http://babeljs.io/docs/plugins/#pluginpresets-options. (While processing preset: "/.../node_modules/react/index.js")

Unknown option: .../node_modules/react/index.js.Children.

特别令人困惑

react-native-katex中的.babelrc文件如下所示:

{
"presets": [
    "react",
    ["env", {
      "targets": {
        "browsers": ["last 2 versions"],
        "node": 8
      }
    }]
  ],
  "plugins": [
    "transform-object-rest-spread",
    "transform-class-properties"
  ]
}

我愿意打赌问题是使用react-native katex包,但我不确定要查找什么或从哪里开始。 此错误仅在构建生产时显示。

0 个答案:

没有答案