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

fix: prev might be undefined #7

Merged
merged 1 commit into from
Feb 4, 2024
Merged

fix: prev might be undefined #7

merged 1 commit into from
Feb 4, 2024

Conversation

jdeniau
Copy link
Contributor

@jdeniau jdeniau commented Feb 4, 2024

Description

I got the following issue when adding a "bullet point only" slide in slidev

20:24:14 [vite] Internal server error: Cannot read properties of undefined (reading 'type')
  Plugin: unplugin-vue-markdown
  File: /@slidev/slides/6.md
      at file:///home/jdeniau/code/julien.deniau.me/public/open-source-howto/node_modules/markdown-it-mdc/dist/index.mjs:411:18
      at Array.forEach (<anonymous>)
      at MarkdownItInlineProps.md.parse (file:///home/jdeniau/code/julien.deniau.me/public/open-source-howto/node_modules/markdown-it-mdc/dist/index.mjs:406:12)
      at MarkdownIt.render (/home/jdeniau/code/julien.deniau.me/public/open-source-howto/node_modules/unplugin-vue-markdown/node_modules/markdown-it/lib/index.js:544:36)
      at file:///home/jdeniau/code/julien.deniau.me/public/open-source-howto/node_modules/unplugin-vue-markdown/dist/chunk-EES4WMNF.js:242:25
      at TransformContext.transform (file:///home/jdeniau/code/julien.deniau.me/public/open-source-howto/node_modules/unplugin-vue-markdown/dist/chunk-EES4WMNF.js:413:37)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async Object.transform (file:///home/jdeniau/code/julien.deniau.me/public/open-source-howto/node_modules/vite/dist/node/chunks/dep-9A4-l-43.js:64063:30)
      at async loadAndTransform (file:///home/jdeniau/code/julien.deniau.me/public/open-source-howto/node_modules/vite/dist/node/chunks/dep-9A4-l-43.js:49741:29)
      at async viteTransformMiddleware (file:///home/jdeniau/code/julien.deniau.me/public/open-source-howto/node_modules/vite/dist/node/chunks/dep-9A4-l-43.js:59342:32

You can experiment yourself by creating a simple slide that only contains this


---
layout:default
---

*  test

Additional context

I do not really know why this is the plugin that is triggering the error, as I did not activate it, but testing that previs defined does fix the issue.

I do not know how to test this though.
I did found the following file, but as I do not want to test MDC, what should I do here ?

Workaround

encapsule the list in a ul:

::ul
- item 1
- item 2
::ul

@antfu antfu merged commit 520a86d into antfu:main Feb 4, 2024
8 checks passed
@jdeniau jdeniau deleted the patch-1 branch February 5, 2024 06:37
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

Successfully merging this pull request may close these issues.

2 participants