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

Path must be a string. Received undefined Use --force to continue. #222

Open
liadlivnat opened this issue Mar 12, 2016 · 16 comments
Open

Path must be a string. Received undefined Use --force to continue. #222

liadlivnat opened this issue Mar 12, 2016 · 16 comments

Comments

@liadlivnat
Copy link

liadlivnat commented Mar 12, 2016

Hi,

for some reason i get this error: Path must be a string. Received undefined Use --force to continue.

this is the grunt.js code:

sass: {
      dist: {
        options: {
          sourcemap: false
        },
        files: {
          'css/main.css' : 'scss/main.scss'
        }
      }
    },

Any idea hot to get rid of the error ?

@digeomel
Copy link

digeomel commented Jun 2, 2016

I get exactly the same. Did you sort it out?

@brunoscopelliti
Copy link

I get the same... then I checked the path I've specified, and found a typo... fix the typo solved the issue.

@digeomel
Copy link

digeomel commented Aug 5, 2016

@n8finch to me it looks like the paths on the left are relative and the paths on the right are absolute, and from the looks of it, the paths on the right are wrong.

@fschroiff
Copy link

@n8finch are you sure this is correct: 'assets/styles/boubon.css'? The library is called Bourbon, with an "r".

@n8finch
Copy link

n8finch commented Nov 15, 2016

@fschroiff haha, months ago:-). Issue resolved.

@mihaiconstantin
Copy link

mihaiconstantin commented Nov 27, 2016

In my case I was running the task and I had no .scss file in that folder. It seems that the task breaks if your folder is empty.

@kirkportas
Copy link

Mine was the same issue as mihaiconstantin. In Node v4.5.0 an empty src dir was fine, but in Node v6.2.0 that's a breaking error: "Path must be a string. Received undefined"

@Rc85
Copy link

Rc85 commented Jun 1, 2017

Is there a solution to this?

 sass: {
     options: {
        compass: true
             },
             dist: {
                 files: [{
                     expanded: true,
                     cwd: "scss", // tried "/scss/", "/scss", "scss/"
                     src: ["*.scss"], // tried "/*.scss"
                     dest: "css",
                     ext: ".css"
                 }]
             }
         }

Nothing works.

@digeomel
Copy link

digeomel commented Jun 1, 2017

@Rc85 try using a dot or two, like cwd: "./scss" or "../scss" depending on where your scss directory lies relative to Gruntfile.js

@Rc85
Copy link

Rc85 commented Jun 2, 2017

@digeomel I tried those. My scss is in the same directory as Gruntfile.js.

My working tree

root
    /scss
    Gruntfile.js

Using "scss", "./scss", or __dirname + "/scss" , I get

Errno::ENOENT No such file or directory @ rb_sysopen - main.scss

Using "/scss", I get

Warning: Path must be a string. Received undefined

I'm out of ideas.

@esr360
Copy link

esr360 commented Oct 5, 2017

I am getting this error on Travis CI only, locally I am not getting this error. Travis has the same node.js version as my local (6.11.4). Could this still be an issue with path name if it works locally and not on Travis? I've ruled out a typo for this reason.

EDIT: For me, it was case sensitivity. For whatever reason, it didn't matter locally on my Mac, but Travis complains if incorrect case.

@lakesare
Copy link

lakesare commented Jun 5, 2018

For me it was the usage of array instead of a string for cwd, src, and dest. This worked:

      files: [{
                  expand: true,
                  cwd: './static/frontend/css/', // Parent folder of original CSS templates
                  src: '*.scss', // Collects all `*.css` files within the parent folder
                  dest: './static/grunted', // Stores the collected `*.css` files in your `src/css/` folder
                  ext: '.css'
       }]

@dmcshehan
Copy link

@brunoscopelliti Mine was the same. There was a typo. Fixed the typo and it worked. Thanks

@Sparlix
Copy link

Sparlix commented Apr 23, 2022

Also same issue, path directory was off, thanks

@atiq-xs
Copy link

atiq-xs commented Jan 6, 2024

Hi,

for some reason i get this error: Path must be a string. Received undefined Use --force to continue.

this is the grunt.js code:

sass: {
      dist: {
        options: {
          sourcemap: false
        },
        files: {
          'css/main.css' : 'scss/main.scss'
        }
      }
    },

Any idea hot to get rid of the error ?

It is 2024 and it still is an issue!!!

@tlsimmons88
Copy link

I too had a typo in the files section of the grunt task. Once I fixed that it worked.

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