djm / remark-shortcodes

A custom Markdown syntax parser for remark that adds support for shortcodes.
MIT License
45 stars 7 forks source link

Error with version 0.2.0 #3

Closed dekryptic closed 6 years ago

dekryptic commented 6 years ago
Uncaught TypeError: Cannot read property 'prototype' of undefined
    at Function.shortcodes (index.js:52)

I don't get an error with 0.1.5.

djm commented 6 years ago

To diagnose this we're going to need a bit more information. Do you have the full traceback and a piece of code or a failing test that can reproduce this error?

dekryptic commented 6 years ago

I'm using react-markdown. Here's an example I was working on: https://codesandbox.io/s/9zo29v9k5o

If you change the version of remark-shortcodes to 0.1.5, it works fine.

djm commented 6 years ago

That's really helpful, thanks.

@ChristianMurphy worked on the 0.2 release, as it added compilation. This is probably related to that, I'll try and get a chance to see why as soon as possible.

ChristianMurphy commented 6 years ago

@dekryptic 0.2.0 requires both remark-parse and remark-stringify. We can make the error messages clearer and/or make the compiler and parser optional.

@djm Do you have a preference on having optional install for compiler and parser (silently skip if one or both is missing), or having errors if one or both are missing?