dts-generator
dts-generator copied to clipboard
Error: Arguments to path.resolve must be string Use --force to continue.
I'm getting the following error:
Running "dtsGenerator:build" (dtsGenerator) task
Warning: Arguments to path.resolve must be strings Use --force to continue.
Aborted due to warnings.
I've followed the grunt task setup described on your page modifying it slightly to fit my use-case but I'm having no luck:
dtsGenerator: {
options: {
name: 'package-name',
project: 'build/',
out: 'package-name.d.ts'
},
build: {
src: [ 'build/**/*.ts' ]
}
}
My TS is compiling as expected into build/src
.
I am having the same problem using almost same code as above. Tried several tricks like using './build' both on project and src, removing the brackets of src, etc... But no luck. Finally, I used command line to get my d.ts file through:
dts-generator --name mylib --project ./ --out mylib.d.ts --exclude "typings/*/.d.ts"
Hope it helps.
I managed to get the task running without errors in grunt by defining a task and running dts-generator programatically:
grunt.task.registerTask('dts', '', function() {
require('dts-generator').default({
name: 'package-name',
project: '.',
out: 'package-name.d.ts',
src: [ 'build/**/*.ts' ],
files: grunt.file.expand(['./src/**/*.ts'])
});
});
I'm getting package-name.d.ts generated, but it's completely empty.
Thanks @janakerman , we'll look at this as soon as possible (unfortunately probably not until next week)
@janakerman I'm seeing the same error, loading tasks using jit-grunt
. Will post if I make any progress.
@janakerman @dylans The error occurs when the baseDir
option is undefined. See https://github.com/SitePen/dts-generator/pull/57 for pull request (you can provide an empty string for baseDir
in the meantime).
@simonrobb - Thanks for looking into that!