Skip to content
This repository has been archived by the owner on Mar 21, 2021. It is now read-only.

SyntaxError: Block-scoped declarations (let, const, function, class) not yet sup ported outside strict mode #4

Closed
lokinderchauhan opened this issue May 18, 2016 · 9 comments
Assignees

Comments

@lokinderchauhan
Copy link

I am generating documentation with angular-jsdoc with gulp. I am successfully able to generate docs with default template but following issue comes with angular-template

processing template: E:\lokinder\tmd\desktop\node_modules\angular-jsdoc\angular-
template\html\layout.html
error in line undefined
E:\lokinder\tmd\desktop\node_modules\angular-template\index.js:140
        throw e;
        ^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet sup
ported outside strict mode
    at Function (native)
    at templateFunc (E:\lokinder\tmd\desktop\node_modules\js-template\index.js:5
6:12)
    at jsTemplate (E:\lokinder\tmd\desktop\node_modules\js-template\index.js:65:
18)
    at angularTemplate (E:\lokinder\tmd\desktop\node_modules\angular-template\in
dex.js:128:14)
@allenhwkim
Copy link
Owner

please use 'use strict' on the first line of your code.

@ticktockreed
Copy link

Hi, I am also experiencing the same issue (see this ticket: allenhwkim/angular-jsdoc#86).

All of my files contain 'use strict' at the top, and compilation worked before a recent update. I have reduced my code to one file as below. Any ideas?

'use strict';
angular.module('rmOBA.printManifest', ['ngRoute'])

.config(['$routeProvider', function($routeProvider) {
    $routeProvider.when('/print_manifest', {
        templateUrl: 'views/print_manifest/print_manifest.html'
    });
}])
/**
* @memberof rmOBA
* @ngdoc controller
* @name PrintManifest
* @param $scope {service} controller scope
* @param rmResources {service} Google NavigatorGeolocation wrapper
* @description 
*   The View Control for the third and final screen of the app
*/
.controller('PrintManifestCtrl',  [
    '$scope', function(
        $scope
    ) {
       console.log('PrintManifestCtrl');
}])

@GaelBi
Copy link

GaelBi commented May 25, 2016

+1 Hi, I meet the same error...

@ronaldsnyder
Copy link

I am also having the same issue.

@RhonanMS
Copy link

RhonanMS commented Jun 1, 2016

The same issue also occurs in my project. All sources have strict mode enabled via 'use strict';

EDIT: I just tried and went back to angular-template@2.0.3 - there the error message is not displayed.

@allenhwkim
Copy link
Owner

allenhwkim commented Jun 1, 2016

@FDIM, can you take a look at this issue? Difference between 2.0.3 and 2.0.9.. I briefly took a look at it and I could not find any bad code.

@w11
Copy link

w11 commented Jun 1, 2016

+1 Same error for me.
Solved also by going back to angular-template@2.0.3

@FDIM
Copy link
Collaborator

FDIM commented Jun 1, 2016

Looking into, but I can't really understand why something like that would happen. Will update soon.

@FDIM
Copy link
Collaborator

FDIM commented Jun 1, 2016

See this PR: allenhwkim/angular-jsdoc#89

@FDIM FDIM closed this as completed Jun 23, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants