3

Hi I'm trying to recreate Golden Layout angular complex application https://golden-layout.com/tutorials/angular-complex.html as a electron application, so basically I just did the quick start example of electron http://electron.atom.io/docs/latest/tutorial/quick-start/ and did all the logic of golden layout on my index.html but it send to me this error:

jQuery is missing as dependency for GoldenLayout. Please either expose $ on GoldenLayout's scope (e.g. window) or add "jquery" to your paths when using RequireJS/AMD

NES
  • 33
  • 6
  • Did you actually add jquery like it's suggesting, and as is suggested first thing in Golden Layout's [getting started guide](https://golden-layout.com/tutorials/getting-started.html)? – Ken Franqueiro Aug 13 '15 at 22:53
  • yes I did but that didn´t work, it seems that you can add the conf `code node-integration : false in order to get this working – NES Aug 17 '15 at 13:54

1 Answers1

4

As indicated in this answer you need to load jquery in the following way (before including golden-layout):

<script>window.$ = window.jQuery = require('./path/to/jquery.js');</script>

If I understand correctly, the issue occurs because jquery 'detects' that it is running in a requireJS environment and load $ and jQuery in modules (not window)

Community
  • 1
  • 1
etienne
  • 3,146
  • 1
  • 24
  • 45
  • You can also use requirejs more explicitly to load jQuery by following this guide https://golden-layout.com/tutorials/requirejs.html – Nick Mitchell Mar 28 '17 at 00:11