Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Arguments to path.resolve must be string Use --force to continue. #46

Open
janakerman opened this issue Nov 18, 2015 · 6 comments

Comments

@janakerman
Copy link

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.

@francisco-verdugo
Copy link

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.

@janakerman
Copy link
Author

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.

@dylans
Copy link
Contributor

dylans commented Dec 16, 2015

Thanks @janakerman , we'll look at this as soon as possible (unfortunately probably not until next week)

@simonrobb
Copy link

@janakerman I'm seeing the same error, loading tasks using jit-grunt. Will post if I make any progress.

@simonrobb
Copy link

@janakerman @dylans The error occurs when the baseDir option is undefined. See #57 for pull request (you can provide an empty string for baseDir in the meantime).

@janakerman
Copy link
Author

@simonrobb - Thanks for looking into that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants