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

Cannot read property 'JST' of undefined with requirejs and use strict mode #48

Open
rbudiharso opened this issue Jun 3, 2014 · 0 comments

Comments

@rbudiharso
Copy link

Here's the Gruntfile config and the produced config.js file created by running grunt build related to requirejs: https://gist.github.com/rbudiharso/a650e581d4e4443e7624#file-config-js-L7

Note that in the produced config.js file, templates is wrapped in AMD define call, also the file is wrapped in strict mode, the problem is that this in this line:
this["JST"] = this["JST"] || {};
is undefined so this line is producing error
Uncaught TypeError: Cannot read property 'JST' of undefined,

The way I fixed it is by editing the templates defined call so that this is replaced with an object like in edited-config.js file.

I don't know if there's anything wrong with my gruntfile configuration or grunt-contrib-jst is incompatible when used with requirejs and strict mode.

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