preactjs/wmr

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

rschristian opened this issue · 0 comments

Discussed in #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:

sourcesCache.set(source, { index: sourcesCache.size, content: map.sourcesContent[j] || null });