grunt-contrib-jst icon indicating copy to clipboard operation
grunt-contrib-jst copied to clipboard

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

Open rbudiharso opened this issue 10 years ago • 0 comments

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.

rbudiharso avatar Jun 03 '14 07:06 rbudiharso