Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

global is not defined #242

Closed
esbenp opened this issue Aug 23, 2014 · 5 comments
Closed

global is not defined #242

esbenp opened this issue Aug 23, 2014 · 5 comments

Comments

@esbenp
Copy link

esbenp commented Aug 23, 2014

I just updated for version 1.3.0-alpha.20140822.2 and I get error Uncaught ReferenceError: global is not defined on line 117 of rangy-core.js . I use rangy with requirejs for wysihtml5 editor. Did i miss something for initialization?

@timdown
Copy link
Owner

timdown commented Aug 23, 2014

Chances are I've messed something up: I've done a bit of rearranging in the code for requirejs and CommonJS recently.

@timdown
Copy link
Owner

timdown commented Aug 23, 2014

I can't replicate this. It sounds like the problem is that I've made a false assumption, namely that this on the last line of rangy-core.js is guaranteed to evaluate to the global object. Could I have a few more details on how Rangy is being included?

@esbenp
Copy link
Author

esbenp commented Aug 24, 2014

It happens when i use wysihtml5 from this repo: https://github.com/Waxolunist/bootstrap3-wysihtml5-bower

I do not quite understand why, but when I install it from bower install bootstrap3-wysihtml5-bower it includes an amd folder in the dist directory and the locales are amd-wrapped. So if you decide to check it out, please install it using bower.

Anywho. It goes something like this.

  1. require a locale via require("dist/locales/bootstrap.wysihtml5.en-US");
  2. The locale lists bootstrap.wysihtml5 as a dependency. In my requirejs shim it points to dist/amd/bootstrap3-wysihtml5.all
  3. On line 3 of dist/amd/bootstrap3-wysihtml5.all it says rangy = require('rangy'); . My requirejs shim points rangy to rangy-official/rangy-core (installed via bower from rangy-official repository)

I hope this helps replicate the error. Let me know if help is needed.

@timdown
Copy link
Owner

timdown commented Aug 25, 2014

Thanks. I've added a contrived piece of code to get the global object that I'm confident will fix this. I'll create a new release tomorrow.

@esbenp
Copy link
Author

esbenp commented Aug 25, 2014

Thanks Tim, that is great news.

On Monday, August 25, 2014, Tim Down notifications@github.com wrote:

Thanks. I've added a contrived piece of code to get the global object that
I'm confident will fix this. I'll create a new release tomorrow.


Reply to this email directly or view it on GitHub
#242 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants