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: Unable to read .js file (Error code: EISDIR). #29

Open
brandon-arnold opened this issue Nov 26, 2014 · 8 comments
Open

Error: Unable to read .js file (Error code: EISDIR). #29

brandon-arnold opened this issue Nov 26, 2014 · 8 comments

Comments

@brandon-arnold
Copy link

Hi all,

It seems the grunt rev section in its current form can't distinguish between a directory ending in ".js" and a .js file. Grunt-rev (and subsequently usemin) will fail with

Warning: Unable to read "dist/public/bower_components/spin.js" file (Error code:
 EISDIR). Use --force to continue.

Aborted due to warnings.

In the below Gruntfile.js section, I fixed the problem by singling out each .js/ directory (spin.js is a project name and a .js file, for example) and excluding it. If you can tell me a more general way to do it by regex I would appreciate it.

    // Renames files for browser caching purposes
    rev: {
      dist: {
        files: {
            src: [
                '<%= yeoman.dist %>/public/**/*.js',
                '<%= yeoman.dist %>/public/**/*.css',
                '<%= yeoman.dist %>/public/assets/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
                '<%= yeoman.dist %>/public/assets/fonts/{,*/}*.ttf',
                '!<%= yeoman.dist %>/public/bower_components/openlayers/tests/node.js',
                '!<%= yeoman.dist %>/public/bower_components/spin.js'
          ]
        }
      }
    },
@jmaxxz
Copy link

jmaxxz commented Dec 15, 2014

👍 this problem history.js is the package causing me issues.

Thanks @brandon-arnold your solution saved me from choosing between a library I use and a working build.

@andrea-spotsoftware
Copy link

I have the same problem.

Anyway thank you @brandon-arnold you saved me also!

@ianzepp
Copy link

ianzepp commented Jun 30, 2015

Note: I ran into this issue with the Auth0 module also:

Warning: Unable to read "dist/public/bower_components/auth0.js" file (Error code: EISDIR). Use --force to continue.

The solution above for spin.js also fixes the auth0.js problem. You may also need to do the same fix in the 'usemin' configuration section as well, if you have one:

        usemin: {
            html: ['<%= yeoman.dist %>/public/{,*/}*.html'],
            css: ['<%= yeoman.dist %>/public/{,*/}*.css'],
            js: [
                '<%= yeoman.dist %>/public/{,*/}*.js',
                '!<%= yeoman.dist %>/public/bower_components/auth0.js'
            ],

@elis
Copy link

elis commented Sep 1, 2015

Any package that ends with .js will produce this error.

@elis
Copy link

elis commented Sep 1, 2015

@ianzepp Your solution doesn't resolve the issue for me.

@brandon-arnold
Copy link
Author

@elis: did you add the line to the rev {} section, too, like the first post? Ianzepp only showed half the solution.

@elis
Copy link

elis commented Sep 2, 2015

Yeah, and it solved the problem. Cheers!

On יום ג׳, 1 בספט׳ 2015 at 16:17 Brandon Arnold [email protected]
wrote:

@elis https://github.com/elis: did you add the line to the rev {}
section, too, like the first post? Ianzepp only showed half the solution.


Reply to this email directly or view it on GitHub
#29 (comment).

@BenjaminConant
Copy link

Worked like a charm... and really good to know!

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

6 participants