Gentman_Dylan 2023-01-30 15:40 采纳率: 50%
浏览 54
已结题

dumi编译运行报错

dumi 编译运行时,会弹出报错,在试了该Github上的解决办法也无效,请问有知道的吗?
报错的问题我也试了是加了红框的代码才报错的,如果注释掉该代码就可以正常运行

img

error - ./src/ZTest/index.md
Module build failed (from ./node_modules/dumi/dist/loaders/markdown/index.js):
Error: invalid type: JsValue(Function(plugin)), expected any value
    at module.exports.__wbindgen_error_new (E:\workspace\zd-ui\node_modules\@swc\wasm\wasm.js:446:17)
    at wasm://wasm/04dc58fa:wasm-function[13010]:0xe41844
    at wasm://wasm/04dc58fa:wasm-function[5753]:0xbe963b
    at wasm://wasm/04dc58fa:wasm-function[2757]:0x9a9d0f
    at wasm://wasm/04dc58fa:wasm-function[234]:0x2bc0b7
    at wasm://wasm/04dc58fa:wasm-function[133]:0x19d55b
    at wasm://wasm/04dc58fa:wasm-function[16191]:0xea27eb
    at Object.module.exports.transformSync (E:\workspace\zd-ui\node_modules\@swc\wasm\wasm.js:333:14)
    at Compiler.transformSync (E:\workspace\zd-ui\node_modules\@swc\core\index.js:248:37)
    at transformSync (E:\workspace\zd-ui\node_modules\@swc\core\index.js:348:21)
    at ReactTechStack.transformCode (E:\workspace\zd-ui\node_modules\dumi\dist\techStacks\react.js:135:54)
    at E:\workspace\zd-ui\node_modules\dumi\dist\loaders\markdown\transformer\rehypeDemo.js:152:37
    at Array.forEach (<anonymous>)
    at E:\workspace\zd-ui\node_modules\dumi\dist\loaders\markdown\transformer\rehypeDemo.js:126:23
    at overload (file:///E:/workspace/zd-ui/node_modules/unist-util-visit/lib/index.js:173:16)
    at node (element<p>) (file:///E:/workspace/zd-ui/node_modules/unist-util-visit-parents/lib/index.js:189:31)
    at node (root) (file:///E:/workspace/zd-ui/node_modules/unist-util-visit-parents/lib/index.js:206:79)
    at visitParents (file:///E:/workspace/zd-ui/node_modules/unist-util-visit-parents/lib/index.js:148:35)
    at visit (file:///E:/workspace/zd-ui/node_modules/unist-util-visit/lib/index.js:165:7)
    at E:\workspace\zd-ui\node_modules\dumi\dist\loaders\markdown\transformer\rehypeDemo.js:122:5
    at wrapped (file:///E:/workspace/zd-ui/node_modules/trough/index.js:115:27)
    at next (file:///E:/workspace/zd-ui/node_modules/trough/index.js:65:23)
    at done (file:///E:/workspace/zd-ui/node_modules/trough/index.js:148:7)
    at then (file:///E:/workspace/zd-ui/node_modules/trough/index.js:158:5)
    at wrapped (file:///E:/workspace/zd-ui/node_modules/trough/index.js:136:9)
    at next (file:///E:/workspace/zd-ui/node_modules/trough/index.js:65:23)
    at done (file:///E:/workspace/zd-ui/node_modules/trough/index.js:148:7)
    at then (file:///E:/workspace/zd-ui/node_modules/trough/index.js:158:5)
    at wrapped (file:///E:/workspace/zd-ui/node_modules/trough/index.js:136:9)
    at next (file:///E:/workspace/zd-ui/node_modules/trough/index.js:65:23)
    at done (file:///E:/workspace/zd-ui/node_modules/trough/index.js:148:7)
    at then (file:///E:/workspace/zd-ui/node_modules/trough/index.js:158:5)
    at wrapped (file:///E:/workspace/zd-ui/node_modules/trough/index.js:136:9)
    at next (file:///E:/workspace/zd-ui/node_modules/trough/index.js:65:23)
    at done (file:///E:/workspace/zd-ui/node_modules/trough/index.js:148:7)
    at then (file:///E:/workspace/zd-ui/node_modules/trough/index.js:158:5)
    at wrapped (file:///E:/workspace/zd-ui/node_modules/trough/index.js:136:9)
    at next (file:///E:/workspace/zd-ui/node_modules/trough/index.js:65:23)
    at done (file:///E:/workspace/zd-ui/node_modules/trough/index.js:148:7)
    at then (file:///E:/workspace/zd-ui/node_modules/trough/index.js:158:5)
    at wrapped (file:///E:/workspace/zd-ui/node_modules/trough/index.js:136:9)
    at next (file:///E:/workspace/zd-ui/node_modules/trough/index.js:65:23)
    at done (file:///E:/workspace/zd-ui/node_modules/trough/index.js:148:7)
    at then (file:///E:/workspace/zd-ui/node_modules/trough/index.js:158:5)
    at wrapped (file:///E:/workspace/zd-ui/node_modules/trough/index.js:136:9)
    at next (file:///E:/workspace/zd-ui/node_modules/trough/index.js:65:23)
    at done (file:///E:/workspace/zd-ui/node_modules/trough/index.js:148:7)
    at then (file:///E:/workspace/zd-ui/node_modules/trough/index.js:158:5)
    at wrapped (file:///E:/workspace/zd-ui/node_modules/trough/index.js:136:9)
    at next (file:///E:/workspace/zd-ui/node_modules/trough/index.js:65:23)

补充:

img

上方的javascript是可以正常编译的,但是使用jsx或tsx时就会报错

  • 写回答

2条回答 默认 最新

  • CodeBytes 2023-01-30 16:30
    关注

    这是一个错误,表示 dumi 编译运行时出现了错误,具体错误内容为:编译 ./src/ZTest/index.md 文件时,出现了模块构建失败的错误,错误原因为数据类型不正确:期望获得任何数值,但实际上是一个 JsValue(Function(plugin))。

    建议检查 ./src/ZTest/index.md 文件的内容和 dumi 的配置,以确定错误原因并解决问题。

    import React from 'react';
    import ZTest from "zd-ui";
    
    export default () => <ZTest msg="hello" />;
    
    评论

报告相同问题?

问题事件

  • 已结题 (查看结题原因) 2月6日
  • 修改了问题 1月30日
  • 创建了问题 1月30日

悬赏问题

  • ¥15 x趋于0时tanx-sinx极限可以拆开算吗
  • ¥500 把面具戴到人脸上,请大家贡献智慧
  • ¥15 任意一个散点图自己下载其js脚本文件并做成独立的案例页面,不要作在线的,要离线状态。
  • ¥15 各位 帮我看看如何写代码,打出来的图形要和如下图呈现的一样,急
  • ¥30 c#打开word开启修订并实时显示批注
  • ¥15 如何解决ldsc的这条报错/index error
  • ¥15 VS2022+WDK驱动开发环境
  • ¥30 关于#java#的问题,请各位专家解答!
  • ¥30 vue+element根据数据循环生成多个table,如何实现最后一列 平均分合并
  • ¥20 pcf8563时钟芯片不启振