I was using flatdoc in my project without using webpack and it used to work fine, now that I switched to webpack I have this error when trying to load a file:
Uncaught TypeError: Cannot read property 'setOptions' of undefined
at Object.Parser.setMarkedOptions (flatdoc.js?2f77:185)
at Object.Parser.parse (flatdoc.js?2f77:171)
at eval (flatdoc.js?2f77:464)
at loadData (flatdoc.js?2f77:53)
at Object.eval (flatdoc.js?2f77:62)
at fire (jquery.js?eedf:3317)
at Object.fireWith [as resolveWith] (jquery.js?eedf:3447)
at done (jquery.js?eedf:9272)
at XMLHttpRequest.eval (jquery.js?eedf:9514)
I managed to hack this by installing marked directly (npm install marked --save), then before I import flatdoc I assigned marked to window, basically:
window.marked = require('marked');
import 'flatdoc';
Which means I now have marked twice imported.
I was using flatdoc in my project without using webpack and it used to work fine, now that I switched to webpack I have this error when trying to load a file:
I managed to hack this by installing
markeddirectly (npm install marked --save), then before I importflatdocI assignedmarkedto window, basically:Which means I now have
markedtwice imported.