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

Uncaught TypeError: Cannot read property 'font-styles' of undefined at f #207

Open
nmgeek opened this issue Nov 6, 2017 · 0 comments
Open

Comments

@nmgeek
Copy link

nmgeek commented Nov 6, 2017

Here is some help for people who get this undefined 'font-styles' error. As best I can tell this is caused by an incompatiblity of the bootstrap3-wysiwyg package with some JS loaders. In my case the loader is SystemJS. I solved the problem by switching to this fork: https://github.com/sharathprabhal/bootstrap3-wysiwyg-commonjs

In my case switching to that fork also required adding the handlebars package as an explicit dependency for my project.

The implication is that the code in this bootstrap3-wysiwyg repository is not CommonJS compliant. See issue, #166.

Regarding the actual nature of the error message it looks to me like this package has a more-or-less global variable called wysihtml5 that gets split into two separate scopes when loaded by SystemJS. The 'font-styles' handlebars template is defined using the tpl property in the first scope but later looked up in the second scope where the tpl template property was never defined.

I suspect that when the .js file from this project is loaded directly from a script directive in html (instead of via SystemJS) the two scopes are one in the same.

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

1 participant