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: Symbol is not defined Use --force to continue. #46

Open
mcknasty opened this issue Dec 2, 2015 · 2 comments
Open

Warning: Symbol is not defined Use --force to continue. #46

mcknasty opened this issue Dec 2, 2015 · 2 comments

Comments

@mcknasty
Copy link

mcknasty commented Dec 2, 2015

Hi,

I'm getting the error about and it does seem very helpful. I even get it when I am running the unit test.

xxxxxxxxxxxx:grunt-include-source xxxxxxxxx$ grunt includeSource
Initializing
Command-line options: --verbose

Reading "Gruntfile.js" Gruntfile...OK

Registering Gruntfile tasks.
Initializing config...OK

Registering "tasks" tasks.
Loading "includeSource.js" tasks...OK

  • includeSource

Registering "grunt-contrib-jshint" local Npm module tasks.
Reading /Users/tmckeown/Documents/Aptana Studio 3 Workspace/book_example/node_modules/grunt-include-source/node_modules/grunt-contrib-jshint/package.json...OK
Parsing /Users/tmckeown/Documents/Aptana Studio 3 Workspace/book_example/node_modules/grunt-include-source/node_modules/grunt-contrib-jshint/package.json...OK
Loading "jshint.js" tasks...OK

  • jshint

Registering "grunt-contrib-clean" local Npm module tasks.
Reading /Users/tmckeown/Documents/Aptana Studio 3 Workspace/book_example/node_modules/grunt-include-source/node_modules/grunt-contrib-clean/package.json...OK
Parsing /Users/tmckeown/Documents/Aptana Studio 3 Workspace/book_example/node_modules/grunt-include-source/node_modules/grunt-contrib-clean/package.json...OK
Loading "clean.js" tasks...OK

  • clean

Registering "grunt-contrib-nodeunit" local Npm module tasks.
Reading /Users/tmckeown/Documents/Aptana Studio 3 Workspace/book_example/node_modules/grunt-include-source/node_modules/grunt-contrib-nodeunit/package.json...OK
Parsing /Users/tmckeown/Documents/Aptana Studio 3 Workspace/book_example/node_modules/grunt-include-source/node_modules/grunt-contrib-nodeunit/package.json...OK
Loading "nodeunit.js" tasks...OK

  • nodeunit

Registering "grunt-lineending" local Npm module tasks.
Reading /Users/tmckeown/Documents/Aptana Studio 3 Workspace/book_example/node_modules/grunt-include-source/node_modules/grunt-lineending/package.json...OK
Parsing /Users/tmckeown/Documents/Aptana Studio 3 Workspace/book_example/node_modules/grunt-include-source/node_modules/grunt-lineending/package.json...OK
Loading "lineending.js" tasks...OK

  • lineending
    Loading "Gruntfile.js" tasks...OK
  • default, test

Running tasks: includeSource

Running "includeSource" task

Running "includeSource:baseUrlHtmlTest" (includeSource) task
Verifying property includeSource.baseUrlHtmlTest exists in config...OK
Files: test/files/baseUrl.html -> tmp/baseUrl.html
Options: basePath="test/files", baseUrl="test/files/", templates={}, typeMappings={}, rename=undefined
Warning: Symbol is not defined Use --force to continue.

Aborted due to warnings.

@jwvdiermen
Copy link
Owner

Sorry, but I'm not able to reproduce this warning. I tried both Windows and Linux (Docker container running the image node:4.2) and ran grunt test, but no warnings about a symbol not being defined.

Any tips on how I can reproduce this? I don't own a mac.

@ahhatem
Copy link

ahhatem commented Feb 9, 2016

Hi, I am facing the same issue, I am also on mac.
The problem is in the "extendr" class. When I commented/disabled, things worked correctly.
I managed to make it work by changing the file to the following:

           options.target = this.target;
            grunt.log.debug('Ahhatem: before adding the type mapping');

            //var typeMappings = extendr.clone(defaultTypeMappings);
            var typeMappings = defaultTypeMappings;

            grunt.log.debug('Ahhatem: after adding the type mapping');
            //extendr.extend(typeMappings, options.typeMappings);
            //extendr.extend(typeMappings, options.typeMappings);
            grunt.log.debug('Ahhatem: after extending the type mapping');

            grunt.log.debug('Base path is "' + options.basePath + '".');

            // Iterate over all specified file groups.
            this.files.forEach(function(file) {
                    grunt.log.debug('Handling output file "' + file.dest + "'...");

                    // Concatenate the source files.
                    var contents = '';
                    var contentSources = file.src.filter(function(filePath) {
                                    grunt.log.debug('Using input file "' + filePath + '".');
                                    // Remove nonexistent files.
                                    if (!grunt.file.exists(filePath)) {
                                            grunt.log.warn('Source file "' + filePath + '" not found.');
                                            return false;
                                    } else {
                                            return true;
                                    }
                            }).map( function(filePath) {
                                    // Read and return the file's source.
                                    return grunt.file.read(filePath);
                            });

                    // Don't bother detecting newline if we have no more than 1 file.
                    if (contentSources.length > 1) {
                            // Detect the newline to use for the content files.
                            // Use the first file to detect the newlines, no use to test all of them.
                            var contentNewline = /\r\n/g.test(contentSources[0]) ? '\r\n' : '\n';

                            // Join the content files as one to be processed.
                            contents = contentSources.join(contentNewline);
                    }
                    else {
                            // Still use join here, since 'contentSources' could have a length of 0?
                            contents = contentSources.join();
                    }

                    // Parse the contents, using a parser based on the target file.
                    var fileType = path.extname(file.dest).substr(1);
                    grunt.log.debug('File type is "' + fileType + '"');

                    // Try and map the file type, using it instead.
                    var mappedFileType = typeMappings[fileType];
                    if (mappedFileType) {
                            grunt.log.debug('File type "' + fileType + '" maps to "' + mappedFileType + '"');
                            fileType = mappedFileType;
                    }

                    var parserFn = parsers[fileType];
                    var findEndMarker = endMarkerParsers[fileType];

                    if (!parserFn) {
                            grunt.log.error('No parser found found file type "' + fileType + '".');
                            return false;
                    }

                    // Get the available templates.
                    var localTemplates = templates;
                    //extendr.safeDeepExtendPlainObjects(localTemplates, options.templates);
                    var typeTemplates = localTemplates[fileType];

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