You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue is that import returns an object like { default: ... }. I forgot about that. I didn't check it because I expected that MDX would crash when given an invalid plugin. My request is to crash if the plugin isn't a function instead of ignoring it.
Actual behavior
MDX happily skipped my invalid plugin without attempting to run it. So I didn't know there is a problem. (I spent 30 minutes on this.)
Runtime
Node v17
Package manager
npm v8
OS
macOS
Build and bundle tools
Next.js
The text was updated successfully, but these errors were encountered:
My request is to crash if the plugin isn't a function instead of ignoring it.
Thing is: we supports presets (which are objects): collections of plugins and/or settings. In this case, it’s seen as a preset without settings, without plugins, and with an unknown field.
Yeah, makes sense, I’m assuming other folks will also run into this.
We could throw on objects that have neither plugins nor settings fields though.
I opened unifiedjs/unified#200. There are some downsides but I think it’s good to have. I think it should go in a major, and I don’t think it’s worth it to cut a major just for this. So I expect it to land, but not soon!
Initial checklist
Affected packages and versions
@mdx-js/mdx@2.1.3
Link to runnable example
No response
Steps to reproduce
This neither crashes nor works.
Expected behavior
The issue is that
import
returns an object like{ default: ... }
. I forgot about that. I didn't check it because I expected that MDX would crash when given an invalid plugin. My request is to crash if the plugin isn't a function instead of ignoring it.Actual behavior
MDX happily skipped my invalid plugin without attempting to run it. So I didn't know there is a problem. (I spent 30 minutes on this.)
Runtime
Node v17
Package manager
npm v8
OS
macOS
Build and bundle tools
Next.js
The text was updated successfully, but these errors were encountered: