【问题标题】:What additional loaders do I need? (Module parse failed: Unexpected token (16:9))我需要哪些额外的装载机? (模块解析失败:意外令牌 (16:9))
【发布时间】:2021-04-25 21:13:30
【问题描述】:

我正在使用一个名为 danfojs 的库,当我编译时它给了我以下错误。

14:01:51.417    Failed to compile.
14:01:51.417    ./node_modules/danfojs/src/index.js 16:9
14:01:51.417    Module parse failed: Unexpected token (16:9)
14:01:51.418    File was processed with these loaders:
14:01:51.418     * ./node_modules/babel-loader/lib/index.js
14:01:51.418    You may need an additional loader to handle the result of these loaders.
14:01:51.418    | export { Str } from "./core/strings";
14:01:51.418    | export { Utils } from "./core/utils";
14:01:51.418    > export * as tf from "@tensorflow/tfjs";
14:01:51.418    | export var _version = "0.2.5";

似乎我需要使用 webpack 设置设置一些额外的加载器,有人能指出如何做到这一点的正确方向吗?

【问题讨论】:

    标签: javascript node.js reactjs webpack


    【解决方案1】:

    您不应该从该库中导入 /src/index.js:这显然是具有 ES6 功能的源代码,当前 Node 不支持。

    【讨论】:

      猜你喜欢
      • 2018-10-25
      • 2019-02-15
      • 2023-03-27
      • 2021-04-26
      • 2021-05-01
      • 2020-11-16
      • 1970-01-01
      • 2021-12-13
      • 2020-07-11
      相关资源
      最近更新 更多