thlorenz / brace

📔 browserify compatible version of the ace editor.
http://thlorenz.github.io/brace/
MIT License
1.06k stars 303 forks source link

Console warning: "TypeError: test is undefined" #131

Open icosamuel opened 6 years ago

icosamuel commented 6 years ago

my specific usage

<div id="editor"></div>
<script>
    let schema = { schema: "json valid" };
    const editor = ace.edit('editor');
    editor.setValue(JSON.stringify(schema, null, 2), 1);
    editor.on('input', () => {
      try {
        schema = JSON.parse(this.editor.getValue());
      } catch (e) {}
    });
</script>

relevant stack trace


TypeError: text is undefined
  Stack trace:
  this.$detectNewLine@webpack-internal:///./node_modules/brace/index.js:7707:13
  this.insert@webpack-internal:///./node_modules/brace/index.js:7779:13
  this.setValue@webpack-internal:///./node_modules/brace/index.js:7687:9
  this.setValue@webpack-internal:///./node_modules/brace/index.js:13109:9
...