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

arguments to path.resolve must be strings #142

Closed
niemyjski opened this issue Feb 16, 2015 · 10 comments · Fixed by #150
Closed

arguments to path.resolve must be strings #142

niemyjski opened this issue Feb 16, 2015 · 10 comments · Fixed by #150
Assignees

Comments

@niemyjski
Copy link

I just tried upgrading our project ( https://github.com/exceptionless/Exceptionless.UI ) from 0.9 to the latest version and I started getting errors:

    Running "karma:all_tests" (karma) task
    Warning: Arguments to path.resolve must be strings Use --force to continue.
    TypeError: Arguments to path.resolve must be strings
        at Object.exports.resolve (path.js:116:15)
        at basePathResolve (C:\Code\Exceptionless.UI\src\node_modules\karma\lib\config.js:86:17)
        at C:\Code\Exceptionless.UI\src\node_modules\karma\lib\config.js:91:31
        at Array.map (native)
        at normalizeConfig (C:\Code\Exceptionless.UI\src\node_modules\karma\lib\config.js:107:56)
        at Object.parseConfig (C:\Code\Exceptionless.UI\src\node_modules\karma\lib\config.js:293:10)
        at Object.exports.start (C:\Code\Exceptionless.UI\src\node_modules\karma\lib\server.js:286:20)
        at Object.<anonymous> (C:\Code\Exceptionless.UI\src\node_modules\grunt-karma\tasks\grunt-karma.js:125:14)
        at Object.<anonymous> (C:\Code\Exceptionless.UI\src\node_modules\grunt\lib\grunt\task.js:264:15)
        at Object.thisTask.fn (C:\Code\Exceptionless.UI\src\node_modules\grunt\lib\grunt\task.js:82:16)

    Aborted due to warnings.

I tried 10.1 and nothing but it definitely happened after .9

niemyjski added a commit to exceptionless/Exceptionless.UI that referenced this issue Feb 16, 2015
@dignifiedquire
Copy link
Member

I'm not entirely clear, did this happen on 0.10.1? Because if it only happened on 0.10.0 that's fine because that release is broken.

@niemyjski
Copy link
Author

I checked 10.0 and 10.1 and both broke it for me. The only one that works for me is 0.9. To reproduce you can pull down that repro and do npm install and then grunt test.

@enigmak
Copy link
Contributor

enigmak commented Mar 26, 2015

I had a similar issue due to the data.files not flattening properly. I changed the grunt-karma.js file by adding data.files =_.flatten(data.files); to line 85. And it works for me now. The _.flatten used to be there in the 0.9 version and the [].concat is not flattening like it should on my machine.

To test it pass files: [['a.js','b.js','c.js'],'d.js','e.js'] under karma -> options -> files in the config and it will break then add the line of code and it will work.

The code now looks like.

    if (data.files || options.files) {
      data.files = [].concat.apply(options.files || [], this.files.map(function(file) {
        return file.src.map(function(src) {
          var obj = {
            pattern: src
          };

          ['watched', 'served', 'included'].forEach(function(opt) {
            if (opt in file) {
              obj[opt] = file[opt];
            }
          });
          return obj;
        });
      }));
      data.files =_.flatten(data.files);
    }

@niemyjski
Copy link
Author

Nice find!, Is there any chance we could add this to the latest release?

@robdmoore
Copy link

I have this problem with 0.10.1 too. 0.9.0 works.

enigmak referenced this issue in enigmak/grunt-karma May 28, 2015
enigmak added a commit to enigmak/grunt-karma that referenced this issue May 28, 2015
dignifiedquire added a commit that referenced this issue May 28, 2015
fix: Flatten files array.  Closes #142
@niemyjski
Copy link
Author

@dignifiedquire I just upgraded to 0.11.1 and I'm still getting the same error.

@niemyjski
Copy link
Author

If you want you can pull down my repo https://github.com/exceptionless/Exceptionless.UI (run npm install and bower install) and then do grunt test, watch it pass all the tests and then upgrade this package and then run it again to watch it fail.

@ollwenjones
Copy link

Same problem here. Was trying to go from 0.8 to 0.11. A lot going on in the 'files' to get all the angular templates compiled, etc.

@dignifiedquire
Copy link
Member

Fixed in 0.11.2.

@niemyjski
Copy link
Author

Thanks! I'll try and check this out soon!

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

Successfully merging a pull request may close this issue.

5 participants