Good evening!
I have noticed that histoire build will fail if you have a link which references a file which is not in the ctx yet. Consider these two files:
src/file1.story.md
If I run histoire dev (or build - it doesn't matter), I get the following error:
Error: [md] Cannot find story file: ./file2.story.md from /home/projects/histoire-vue3-starter-jpcz1f/src/file1.story.md
at md.renderer.rules.link_open (file:///home/projects/histoire-vue3-starter-jpcz1f/node_modules/histoire/dist/node/markdown.js:79:31)
at Renderer.renderInline (file:///home/projects/histoire-vue3-starter-jpcz1f/node_modules/markdown-it/lib/renderer.js:275:28)
at Renderer.render (file:///home/projects/histoire-vue3-starter-jpcz1f/node_modules/markdown-it/lib/renderer.js:330:22)
at MarkdownIt.render (file:///home/projects/histoire-vue3-starter-jpcz1f/node_modules/markdown-it/lib/index.js:544:24)
at addFile (file:///home/projects/histoire-vue3-starter-jpcz1f/node_modules/histoire/dist/node/markdown.js:147:25)
at async FSWatcher.eval (file:///home/projects/histoire-vue3-starter-jpcz1f/node_modules/histoire/dist/node/markdown.js:203:9)
After a small research I have found that the problem was that markdown-it for file1 starts running link_open rule before actually finishing collecting all the .md files from the .md watcher. For simplicity I have attached a repro in Stackblitz
Describe the bug
Good evening! I have noticed that histoire build will fail if you have a link which references a file which is not in the ctx yet. Consider these two files:
src/file1.story.md
src/file2.story.md
If I run
histoire dev
(orbuild
- it doesn't matter), I get the following error:After a small research I have found that the problem was that markdown-it for file1 starts running
link_open
rule before actually finishing collecting all the.md
files from the.md
watcher. For simplicity I have attached a repro in StackblitzReproduction
https://stackblitz.com/edit/histoire-vue3-starter-jpcz1f?file=src%2Ffile2.story.md,src%2Ffile1.story.md
System Info
Used Package Manager
npm
Validations