dumi 编译运行时,会弹出报错,在试了该Github上的解决办法也无效,请问有知道的吗?
报错的问题我也试了是加了红框的代码才报错的,如果注释掉该代码就可以正常运行
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)
补充:
上方的javascript是可以正常编译的,但是使用jsx或tsx时就会报错