小编ddb*_*air的帖子

“您可能需要一个额外的加载器来处理这些加载器的结果。” 尝试将自定义模块导入 TSX 文件时

我有一个自定义节点模块,已添加到我的 React 项目中。当我从模块导入组件并运行应用程序时,它返回错误:

Compiled with problems:

ERROR in ./node_modules/react-quick-reactions/src/components/QuickReactions.tsx 4:29

Module parse failed: Unexpected token (4:29)
File was processed with these loaders:
 * ./node_modules/source-map-loader/dist/cjs.js
You may need an additional loader to handle the result of these loaders.
| import { PopoverProps } from "../types/types";
| 
> const QuickReactions = (props: PopoverProps) => {
|   const {
|     isVisible = false,
Run Code Online (Sandbox Code Playgroud)

我试图找到类似的问题,但其他人遇到了无效合并运算符的问题,这些运算符不在问题行上,更不用说在文件中使用了。模块的文件:

import { useMemo, useState } from "react";
import { PopoverProps } from "../types/types";

const QuickReactions = (props: PopoverProps) => …
Run Code Online (Sandbox Code Playgroud)

node-modules typescript reactjs

7
推荐指数
0
解决办法
2035
查看次数

标签 统计

node-modules ×1

reactjs ×1

typescript ×1