pngwn / MDsveX

A markdown preprocessor for Svelte.
https://mdsvex.pngwn.io
MIT License
2.34k stars 101 forks source link

Cannot read property 'children' of undefined on build #377

Open joeinnes opened 2 years ago

joeinnes commented 2 years ago

Hi all!

I get the following error: Cannot read property 'children' of undefined when running on SvelteKit.

This blocks building, but not the dev mode server, and actually, the pages seem to load properly despite the error.

{
  name: 'TypeError',
  id: '/Users/joe/WebDev/joeinn.es/src/routes/posts/a-few-snaps-from-my-birthday.md',
  message: " Cannot read property 'children' of undefined",
  frame: '',
  code: undefined,
  stack: '',
  plugin: 'vite-plugin-svelte',
  pluginCode: '---\n' +
    'title: A Few Snaps From My Birthday\n' +
    'date_published: 2020-01-22T21:32:44.000Z\n' +
    'date_updated: 2020-03-11T22:07:04.000Z\n' +
    'slug: a-few-snaps-from-my-birthday\n' +
    'published: true\n' +
    'image: /uploads//E5A809E0-43FB-4852-9B9C-3AB2ACE6C8F2_1_105_c.jpeg\n' +
    '---\n'
}

My implementation is not super complex anyway, so a (fairly) minimal reproduction can be found here: https://github.com/joeinnes/joeinn.es

Thanks for any help!

pngwn commented 2 years ago

I'll take a look at this.