-
Notifications
You must be signed in to change notification settings - Fork 37
Fatal error: Cannot call method 'accept' of undefined #12
Comments
Experiencing the exact same problem. I found that the following work fine: So there error seem to have something to do with the ordering. |
This SEEM to be caused by both visual studio AND the Typescript task building the same files. |
I'm not running Visual Studio, but we do build our typescript via a grunt task that watches for changes. The error seems to occur whether the watcher is running or not. |
Similar problem here when attempting to lint after typescript compilation. Using This fails:
This works but is the wrong way around (I'd rather be linting after successful compilation):
|
@milkisevil can you please post your gruntfile? |
Sure @adidahiya , I've reduced down to the relevant parts and re-tested. This continues to have same behaviour as described previously. module.exports = function (grunt) {
var typescriptPaths = [
'src/script/base/pattern/Event.ts',
// ... 128 files omitted for berevity ...
'src/script/MainContext.ts'
];
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
typescript: {
base: {
src: typescriptPaths,
dest: 'build/script/main.js',
options: {
target: 'es5',
sourceMap: true
}
}
},
tslint: {
options: {
configuration: grunt.file.readJSON("tslint.json")
},
files: {
src: typescriptPaths
}
}
}
);
grunt.loadNpmTasks('grunt-typescript');
grunt.loadNpmTasks('grunt-tslint');
// BUG: `tslint` should ideally be run AFTER `typescript` but: https://github.com/palantir/grunt-tslint/issues/12
grunt.registerTask('scriptNotWorking', ['typescript', 'tslint']);
grunt.registerTask('scriptWorkingButNotIdeal', ['tslint', 'typescript']);
} Thanks! |
I have a grunt task setup like so:
When it runs tslint as part of that task, it always throws the "Cannot call method 'accept' of undefined" error while running. However, I can run just the tslint task by itself without issue. If I comment out the typescript build step, it also works correctly.
The error does not include a stack trace or any more details. Running with --debug doesn't produce any more useful output. Running with --verbose shows it reading some files, then the error message appears and it crashes.
Here are my task definitions:
Do you have any idea what could be causing this or how I can get more information about the source of the failure?
Thanks,
Chris
The text was updated successfully, but these errors were encountered: