Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在使用 Typora 编写文档时,程序会崩溃 #17

Closed
huankong233 opened this issue Nov 20, 2023 · 2 comments
Closed

在使用 Typora 编写文档时,程序会崩溃 #17

huankong233 opened this issue Nov 20, 2023 · 2 comments

Comments

@huankong233
Copy link
Contributor

huankong233 commented Nov 20, 2023

可以加一个选项来选择excude选项吗

return {
include: ['**/*.md'],
frontmatter: [
localesNotesDirs.length
? {
// note 首页链接
include: localesNotesDirs.map((dir) =>
normalizePath(path.join(dir, '**/{readme,README,index}.md'))
),
frontmatter: {
title(title: string, { filepath }) {
if (title) return title
const note = findNote(filepath)
if (note?.text) return note.text
return getCurrentDirname(note, filepath) || ''
},
...baseFrontmatter,
permalink(permalink: string, { filepath }) {
if (permalink) return permalink
const locale = resolveLocale(filepath)
const notes = notesByLocale(locale)
const note = findNote(filepath)
return normalizePath(
path.join(
locale,
notes?.link || '',
note?.link || getCurrentDirname(note, filepath),
'/'
)
)
},
},
}
: '',
localesNotesDirs.length
? {
include: localesNotesDirs.map((dir) =>
normalizePath(path.join(dir, '**/**.md'))
),
frontmatter: {
title(title: string, { filepath }) {
if (title) return title
const basename = path.basename(filepath, '.md')
return basename
},
...baseFrontmatter,
permalink(permalink: string, { filepath }) {
if (permalink) return permalink
const locale = resolveLocale(filepath)
const note = findNote(filepath)
const notes = notesByLocale(locale)
return normalizePath(
path.join(
locale,
notes?.link || '',
note?.link || getCurrentDirname(note, filepath),
nanoid(),
'/'
)
)
},
},
}
: '',
{
include: '**/{readme,README,index}.md',
frontmatter: {},
},
{
include: '*',
frontmatter: {
title(title: string, { filepath }) {
if (title) return title
const basename = path.basename(filepath, '.md')
return basename
},
...baseFrontmatter,
permalink(permalink: string, { filepath }) {
if (permalink) return permalink
const locale = resolveLocale(filepath)
return normalizePath(
path.join(locale, articlePrefix, nanoid(), '/')
)
},
},
},
].filter(Boolean) as FrontmatterArray,
}

在我使用 Typora 编写文档时,程序会崩溃

我翻了一下源码,我看到可以配置不监控哪些文件

exclude = ['.vuepress/**/*', 'node_modules'],

报错日志

❯ pd

> blog@1.0.0 dev C:\Users\huan_kong\Desktop\code\blog
> vuepress dev src --clean-cache --clean-temp

✔ Cleaning temp - done in 30ms
✔ Cleaning cache - done in 5ms
✔ Initializing and preparing data - done in 4.50s

  vite v4.4.11 dev server running at:

  ➜  Local:   http://localhost:8081/
  ➜  Network: http://192.168.31.104:8081/
  ➜  Network: http://172.22.132.245:8081/
info page note\algorithm\2.数据结构\数组.md is created
info page note\algorithm\2.数据结构\数组.md is modified
info page note\algorithm\2.数据结构\1.数组.md is removed
10:40:20 [vite] page reload C:/Users/huan_kong/Desktop/code/blog/src/.vuepress/.temp/internal/pagesComponents.
10:40:20 [vite] page reload C:/Users/huan_kong/Desktop/code/blog/src/.vuepress/.temp/internal/pagesData.js
10:40:20 [vite] page reload C:/Users/huan_kong/Desktop/code/blog/src/.vuepress/.temp/internal/pagesRoutes.js
10:40:20 [vite] hmr update /@fs/C:/Users/huan_kong/Desktop/code/blog/src/.vuepress/.temp/internal/notesData.js
10:40:20 [vite] hmr update /@fs/C:/Users/huan_kong/Desktop/code/blog/src/.vuepress/.temp/internal/blogData.js
10:40:20 [vite] page reload C:/Users/huan_kong/Desktop/code/blog/src/.vuepress/.temp/internal/pagesComponents.
10:40:20 [vite] page reload C:/Users/huan_kong/Desktop/code/blog/src/.vuepress/.temp/internal/pagesData.js
10:40:20 [vite] page reload C:/Users/huan_kong/Desktop/code/blog/src/.vuepress/.temp/internal/pagesRoutes.js
node:fs:1690
  handleErrorFromBinding(ctx);
  ^

Error: ENOENT: no such file or directory, stat 'C:\Users\huan_kong\Desktop\code\blog\src\note\algorithm\2.数据md'
    at Object.statSync (node:fs:1690:3)
    at readMarkdown (file:///C:/Users/huan_kong/Desktop/code/blog/node_modules/.pnpm/@vuepress-plume+vuepress-frontmatter@1.0.0-beta.85/node_modules/@vuepress-plume/vuepress-plugin-auto-frontmatter/lib/node/readFiles.js:
    at FSWatcher.<anonymous> (file:///C:/Users/huan_kong/Desktop/code/blog/node_modules/.pnpm/@vuepress-plume+gin-auto-frontmatter@1.0.0-beta.85/node_modules/@vuepress-plume/vuepress-plugin-auto-frontmatter/lib/node/plug    at FSWatcher.emit (node:events:514:28)
    at FSWatcher.emitWithAll (C:\Users\huan_kong\Desktop\code\blog\node_modules\.pnpm\chokidar@3.5.3\node_modu\index.js:540:8)
    at FSWatcher._emit (C:\Users\huan_kong\Desktop\code\blog\node_modules\.pnpm\chokidar@3.5.3\node_modules\ch.js:632:8)
    at NodeFsHandler._handleFile (C:\Users\huan_kong\Desktop\code\blog\node_modules\.pnpm\chokidar@3.5.3\node_idar\lib\nodefs-handler.js:400:14)
    at NodeFsHandler._addToNodeFs (C:\Users\huan_kong\Desktop\code\blog\node_modules\.pnpm\chokidar@3.5.3\nodekidar\lib\nodefs-handler.js:637:21) {
  errno: -4058,
  syscall: 'stat',
  code: 'ENOENT',
  path: 'C:\\Users\\huan_kong\\Desktop\\code\\blog\\src\\note\\algorithm\\2.数据结构\\.~数组.md'
}
@pengzhanbo
Copy link
Owner

pengzhanbo commented Nov 20, 2023

👍
已合并发布。

@huankong233
Copy link
Contributor Author

👍 已合并发布。

🤝

@huankong233 huankong233 changed the title 在使用 typecho 编写文档时,程序会崩溃 在使用 Typora 编写文档时,程序会崩溃 Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants