Hi All,
I’m having trouble getting the Merge view working with Require.js. I need to have all assets served up locally, so I placed the diff_match_patch.js file in the same directory as merge.js because I thought that merge.js was expecting it there:
// merge.js
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror", "diff_match_patch"], mod);
But looking at my inspector, I was seing
"NetworkError: 404 Not Found - http://localhost:8080/js/diff_match_patch.js"
So I moved diff_match_patch.js to the /js/ directory. (which isn’t ideal, but okay if it works)
No 404s, but now I’m seeing this:
// merge.js
// (line 550, col 12)
"TypeError: diff_match_patch is not a constructor
var dmp = new diff_match_patch();"
I’m not sure what I’m doing wrong, but if anyone could shed some light on this, it’d be great. The rest of the CodeMirror installation is working fine. I’m using it on another page to just show/edit some code, and it, plus all the addons, are working as expected.
Thanks!