javascript - Yeoman (bower,grunt) - 'SockJS' is not defined -
i trying manage javascript frontend application yeoman. don't have yeoman experience. while running grunt command getting error:
running "jshint:all" (jshint) task linting app/scripts/services/stopmoversockjs.js ...error [l7:c26] w117: 'sockjs' not defined. var socket = new sockjs(url);
i have defined sock js dependency in bower.json :
{ "name": "web", "version": "0.0.0", "dependencies": { "sockjs": "~0.3.4", "angular": "~1.0.7", ...
and bower install command runs without problems , downloads dependencies including sockjs.
this file grunt command complains :
'use strict'; angular.module('webapp').factory('sockjshelper', function($rootscope) { function handler(url) { var socket = new sockjs(url); //it complains line ....
what have in order make sockjs recognized?
jshint thinks sockjs undefined because cannot find in script; if have loaded in through browser! fix behaviour, add jshint config in gruntfile:
jshint: { options: { // of other options... predef: ['sockjs'] }, files : ['path/to/main.js'] },
Comments
Post a Comment