preactjs / wmr

👩‍🚀 The tiny all-in-one development tool for modern web apps.
https://wmr.dev/
MIT License
4.92k stars 109 forks source link

@mdx-js/rollup plugin doesn't work in development mode #926

Closed rschristian closed 2 years ago

rschristian commented 2 years ago

Discussed in https://github.com/preactjs/wmr/discussions/925

Originally posted by **offsounder** April 30, 2022 Hello, I'm trying to use the @mdx-js/rollup plugin with wmr, however it errors out when running in development mode with the following message: Cannot read properties of undefined (reading '0'). When building with wmr --prerender, the md is correctly rendered to html. Any ideas on what is going on?

map.sourcesContent might not exist so this throws:

https://github.com/preactjs/wmr/blob/1d304458829ebf18f219851eb4e55b313d1f7d65/packages/wmr/src/lib/sourcemap.js#L112