diff --git a/client/modules/IDE/components/Console.js b/client/modules/IDE/components/Console.js index bb08e59b..9a527ccf 100644 --- a/client/modules/IDE/components/Console.js +++ b/client/modules/IDE/components/Console.js @@ -27,6 +27,7 @@ class Console extends React.Component { if (nextProps.isPlaying && !this.props.isPlaying) { this.children = []; } else if (nextProps.consoleEvent !== this.props.consoleEvent && this.props.isPlaying) { + console.log(nextProps.consoleEvent); nextProps.consoleEvent.forEach(consoleEvent => { if (consoleEvent.source === 'sketch') { const args = consoleEvent.arguments; diff --git a/client/modules/IDE/components/PreviewFrame.js b/client/modules/IDE/components/PreviewFrame.js index 8b0fb79e..4251db10 100644 --- a/client/modules/IDE/components/PreviewFrame.js +++ b/client/modules/IDE/components/PreviewFrame.js @@ -101,11 +101,12 @@ function hijackConsoleErrorsScript(offs) { var fileInfo = getScriptOff(lineNumber); data = msg + ' (' + fileInfo[1] + ': line ' + fileInfo[0] + ')'; } - window.parent.postMessage({ + + window.parent.postMessage([{ method: 'error', arguments: data, source: 'sketch' - }, '*'); + }], '*'); return false; }; `;