I am trying to get a simple sample working of running Ace inside of an Electron app.
I started by copying the 1.4.12 version of ace-builds/src-noconflict directory contents into app/lib/ace in my app. The contents of app/index.html is:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Ace Editor in Electron</title>
<style type="text/css" media="screen">
#editor { position: absolute; top: 0; right: 0; bottom: 0; left: 0; }
</style>
</head>
<body>
<div id="editor">function test () {}</div>
<script src="lib/ace/ace.js" type="text/javascript" charset="utf-8"></script>
<script>
const editor = ace.edit('editor')
editor.setTheme('ace/theme/twilight')
editor.setMode('ace/mode/javascript')
</script>
</body>
</html>
When I run the electron app, I see the following errors in the Developer Tool console:
Uncaught TypeError: Cannot read property 'inherits' of undefined
at ace.js:6514
at lookup (ace.js:141)
at _require (ace.js:75)
at req (ace.js:138)
at ace.js:6541
at lookup (ace.js:141)
at _require (ace.js:75)
at req (ace.js:138)
at ace.js:9215
at lookup (ace.js:141)
Uncaught TypeError: ace.edit is not a function
at index.html:15
Surely I must be doing something stupid. I searched the Internet looking for examples of running Ace inside of Electron but the few I found were very out of date (and had similar errors).
I am trying to get a simple sample working of running Ace inside of an Electron app.
I started by copying the 1.4.12 version of
ace-builds/src-noconflictdirectory contents intoapp/lib/acein my app. The contents ofapp/index.htmlis:When I run the electron app, I see the following errors in the Developer Tool console:
Surely I must be doing something stupid. I searched the Internet looking for examples of running Ace inside of Electron but the few I found were very out of date (and had similar errors).