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

Warning: Cannot read property 'filter' of undefined Use --force to continue. #4

Open
amiiit opened this issue Nov 27, 2016 · 2 comments

Comments

@amiiit
Copy link
Contributor

amiiit commented Nov 27, 2016

Trying to use with the following config similar to the docs:

module.exports = function(grunt) {
  grunt.initConfig({
    spreadsheet_to_json: {
      options: {
          keyfile: 'MY-APP-KEY-d2400e48869d.json',
          spreadsheetId: '1eCvbblOwZ---MYSPREADSHEET----rl0KP4xc89I'
      },
      content: {
        dest: 'translations/'
      }
    }
  });
  grunt.loadNpmTasks('grunt-spreadsheet-to-json');
};

Then the following code of this extensions throws an error:

            var src = f.src.filter(function (filepath) {
                // Warn on and remove invalid source files (if nonull was set).
                if (!grunt.file.exists(filepath)) {
                    grunt.log.warn('Source file "' + filepath + '" not found.');
                    return false;
                } else {
                    return true;
                }
            }).map(function (filepath) {
                // Read file source.
                return grunt.file.read(filepath);
            }).join(grunt.util.normalizelf(options.separator));

Since f.src is undefined we get the following error:

Warning: Cannot read property 'filter' of undefined Use --force to continue.

What kind of source files are expected exactly? As far as I understand the source is the spreadsheet and we just have a target file?

Thanks

@Schepp
Copy link
Owner

Schepp commented Nov 27, 2016

Honestly I don't remember anymore. But I have the strong suspicion that I left this part in from the original template from which I derived my plugin. Should be fine if you remove the aforementioned code part.

@stevetrask
Copy link

@amiiit did removing this fix your issue?

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

No branches or pull requests

3 participants