Closed mudgen closed 4 years ago
I added CodeFlask by adding "https://unpkg.com/codeflask/build/codeflask.min.js" to my webpage.
Then I tried to use it like this:
window.onload = function () { const flask = CodeFlask("#editorCode", { language: 'js' }); }
Then I get this error in Chrome:
codeflask.min.js:formatted:608 Uncaught TypeError: Cannot set property 'editorRoot' of undefined at d (codeflask.min.js:formatted:608) at window.onload (app.js:94)
How can this be fixed?
It looks like you forgot the new before CodeFlask.
new
CodeFlask
Each editor run as a new instance, so the code should be:
window.onload = function () { const flask = new CodeFlask("#editorCode", { language: 'js' }); }
I added CodeFlask by adding "https://unpkg.com/codeflask/build/codeflask.min.js" to my webpage.
Then I tried to use it like this:
Then I get this error in Chrome:
How can this be fixed?