Tuesday, December 2, 2014

requirejs throws TypeError

Meet this issue today when using requirejs optimizer r.js:

Tracing dependencies for: myapp
[Error: Error: Parse error using esprima for file: /Users/jimz/Workshop/test.js
TypeError: Cannot read property 'type' of null
    at /Users/jimz/Workshop/test/node_modules/grunt-contrib-requirejs/node_modules/requirejs/bin/r.js:23452:47
]

After jshint, found in define([xxxx]) module, there is a duplicate comma something like
define(['a', 'b', , 'c'], function(a1, b1, c1) {})

No comments:

Post a Comment