Closed changweihua closed 3 months ago
⠋ building client + server bundles...parse markdown error in function transformCodeToComponent parse markdown error in function transformCodeToComponent ⠼ building client + server bundles...parse markdown error in function transformCodeToComponent
There are something helpful .
When markdown content contains demo
, error will occured .
const hasDemo = node.children[0].value.trim().match(/demo\s*(.*)$/)
Rollup failed to resolve import "virtual:vite_npm.
still something more need to be found because when my files building, parse markdown error in function transformCodeToComponent
was shown many times
你编译报错时的markdown是怎么写的?
const hasDemo = node.children[0].value.trim().match(/demo\s*(.*)$/)
你觉得是这段代码引起的?
猜测,因为我把demo换成sample就没问题了
sample
项目,安装该开发中的库:
# 安装:这里link相当于install
npm link packagename
# 从`sample`项目的node_modules目录中删除该库,
# 但库的软链接还是会留在全局的node_modules目录中
npm unlink packagename
查看sample
项目中,是否成功安装该库:
你可以试试,把sample换成demo。
我在子项目docs
里试了,没重现你的遇到的编译错误
demo
项目,安装该开发中的库:
# 安装:这里link相当于install
npm link packagename
# 从`demo`项目的node_modules目录中删除该库,
# 但库的软链接还是会留在全局的node_modules目录中
npm unlink packagename
查看demo
项目中,是否成功安装该库:
你看我的,是在代码块内还有个demo
# 安装:这里link相当于install
npm link packagename
# 从`sample`项目的node_modules目录中删除该库,
# 但库的软链接还是会留在全局的node_modules目录中
npm unlink packagename
判断demo是不是应该用:::demo比较好,和下面判断 :::demo src 一样
判断demo是不是应该用:::demo比较好,和下面判断 :::demo src 一样
plugin
子项目推更新了,大概半小时这样npm就刷新了缓存了
我直接改成严格全等了
const hasDemo = node.children[0].value.trim() === ':::demo'
When i try to run docs build, it failed.
Any thing about rollup?
x Build failed in 8.94s ✖ building client + server bundles... parse markdown error in function transformCodeToComponent build error: [vite]: Rollup failed to resolve import "virtual:vite_npm.md.21e0c5cf.bash" from "/home/runner/work/changweihua.github.io/changweihua.github.io/zh-CN/blog/2024-07/vite_npm.md". This is most likely unintended because it can break your application at runtime. If you do want to externalize this module explicitly add it to
build.rollupOptions.external
[vite]: Rollup failed to resolve import "virtual:vite_npm.md.21e0c5cf.bash" from "/home/runner/work/changweihua.github.io/changweihua.github.io/zh-CN/blog/2024-07/vite_npm.md". This is most likely unintended because it can break your application at runtime. If you do want to externalize this module explicitly add it tobuild.rollupOptions.external
at viteWarn (file:///home/runner/work/changweihua.github.io/changweihua.github.io/node_modules/vite/dist/node/chunks/dep-BzOvws4Y.js:65477:17) at onRollupWarning (file:///home/runner/work/changweihua.github.io/changweihua.github.io/node_modules/vite/dist/node/chunks/dep-BzOvws4Y.js:65509:5) at onwarn (file:///home/runner/work/changweihua.github.io/changweihua.github.io/node_modules/vite/dist/node/chunks/dep-BzOvws4Y.js:65172:7) at file:///home/runner/work/changweihua.github.io/changweihua.github.io/node_modules/rollup/dist/es/shared/node-entry.js:18646:13 at Object.logger [as onLog] (file:///home/runner/work/changweihua.github.io/changweihua.github.io/node_modules/rollup/dist/es/shared/node-entry.js:20301:9) at ModuleLoader.handleInvalidResolvedId (file:///home/runner/work/changweihua.github.io/changweihua.github.io/node_modules/rollup/dist/es/shared/node-entry.js:19236:26) at file:///home/runner/work/changweihua.github.io/changweihua.github.io/node_modules/rollup/dist/es/shared/node-entry.js:19194:26 Error: Process completed with exit code 1.