-
Notifications
You must be signed in to change notification settings - Fork 53
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
Demo's and library isn't working - TypeError: Cannot read property 'configure' of undefined #26
Comments
HI @HollandBen , Thanks for reporting. The demo page seems working well for me. |
It's getting a response, but with nothing in the body of it. If I go directly to http://yandex.st/highlightjs/8.0/highlight.min.js then I can see the code. I'm currently using Chrome v35. Just checked it in a few other browsers and it's working fine. Weird. |
I'm having the same issue while using the library in my code. The issue is coming from this line which expects hljs to exist as a property on window, but the property is not set. |
I've determined the real cause is that I wasn't including the original highlightjs library. Additionally, I'm using Browserify and expected this library to be pulled in automatically. I'm working on a pull request which will solve for this. |
This error happens when I use the npm modules for both |
Will work on it this weekend. Thanks for the information! |
@stickel I just updated the module pattern to UMD. It's on |
@pc035860 Close. As it is in (function (root, factory) {
if (typeof define === "function" && define.amd) {
define(["angular", "hljs"], factory);
} else if (typeof module === "object" && module.exports) {
module.exports = factory(require("angular"), require("highlight.js"));
} else {
root.returnExports = factory(root.angular, root.hljs);
}
}(this, function (angular, hljs) { to this: (function (root, factory) {
if (typeof define === "function" && define.amd) {
// define(["angular", "hljs"], factory);
module.exports = factory(require("angular"), require("highlight.js"));
} else if (typeof module === "object" && module.exports) {
module.exports = factory(require("angular"), require("highlight.js"));
} else {
root.returnExports = factory(root.angular, root.hljs);
}
}(this, function (angular, hljs) { Everything started working with webpack. Not sure if/how it'll affect other build tools though. I posted a few other files for the test app I was using in this gist as well to give you more context. |
It seems that webpack's define(["angular", "hljs"], factory); being looked up in your installed npm modules, where it can't find I've updated the module name to sync with the CommonJS one. And It should be fine on |
@pc035860 Downloaded and tested the files from |
Just released v0.4.3. Thanks! |
@pc035860 I still see this with v0.4.3 (and angular 1.3.17)
|
Actually - I missed the removal of the highlight.js dependency. Looks like we need to include that separately (using bower for this)? |
There's actually no official bower package of highlight.js now (see here). Since you're using webpack, this should work for you. I'm still wondering whether to add |
@pc035860 Have you updated the |
@stickel I forgot to publish the new version to npm... And I'm having some trouble publishing it at home. Will try to publish it tomorrow at work! |
v0.4.3 published on npm now. Sorry for the delay! |
to
|
Last one did the trick for me (loading |
@ghost Still helpful. ): |
The demo page is no longer working. The error in the console reads:
TypeError: Cannot read property 'configure' of undefined
The text was updated successfully, but these errors were encountered: