empress / ember-cli-showdown

Ember component to render markdown into HTML.
https://empress.github.io/ember-cli-showdown/
MIT License
101 stars 35 forks source link

Fastboot Extension Issue #55

Closed deanmraz closed 7 years ago

deanmraz commented 7 years ago

Issue:

Error: Error in myextensionname extension-> sub-extension 0: property "type" must be a string, but undefined given

Notes

Example Project

I will be looking for solution but just wanted to open this issue to see if anyone has already solved it!

deanmraz commented 7 years ago

@gcollazo let me know if you have any thoughts.

jasonmit commented 7 years ago

I'll take a look as soon as I can. Thank you for the example, will speed up the process.

jasonmit commented 7 years ago

@deanmraz just an update, looks like showdown is taking a wrong path: https://github.com/showdownjs/showdown/blob/b5e46fdb8dd72ddc74c532e80410536c0a38523c/src/showdown.js#L195

Showdown is wrapping an array within an array because isArray(ext) === false when it should be true.

image

This is likely an issue with the use of Fastboot's use of Node's VM API that the Ember app is run within. Speculation... need to dig deeper.

jasonmit commented 7 years ago

https://github.com/nodejs/node/issues/855#issuecomment-74583712 I believe is the root of the problem. The work around for now is do not return an array from within your extension function.

jasonmit commented 7 years ago

https://github.com/showdownjs/showdown/pull/425 is the fix, will need to wait for it to be merged/versioned.

jasonmit commented 7 years ago

Reopening since I have a patch on our end. Minor breaking change so will version as 4.0.0. The breaking change is no longer rely on the showdown global and require it to be imported.

jasonmit commented 7 years ago

Released as 4.0.0

deanmraz commented 7 years ago

@jasonmit confirmed it works in my project, thanks man great work!