gulp-postcss icon indicating copy to clipboard operation
gulp-postcss copied to clipboard

ENOENT: No such file or directory (sass/postcss/tailwind)

Open asertym opened this issue 3 years ago • 0 comments

I started getting this error on a project that worked fine just a couple of months ago, is this issue related to tailwind?

gulp-notify: [gulp error in gulp-postcss] Error in plugin "gulp-postcss"
Message:
    ENOENT: no such file or directory, stat 'src/assets/styles/style.css'
Details:
    errno: -2
    syscall: stat
    code: ENOENT
    path: src/assets/styles/style.css
    fileName: src/assets/styles/style.css

Stack:
Error: ENOENT: no such file or directory, stat 'src/assets/styles/style.css'
    at Object.statSync (fs.js:1016:3)
    at trackModified (node_modules/tailwindcss/lib/lib/setupContextUtils.js:468:46)
    at Object.getContext (node_modules/tailwindcss/lib/lib/setupContextUtils.js:858:5)
    at node_modules/tailwindcss/lib/lib/setupTrackingContext.js:39:53
    at node_modules/tailwindcss/lib/processTailwindFeatures.js:38:11
    at plugins (node_modules/tailwindcss/lib/index.js:33:58)
    at LazyResult.runOnRoot (node_modules/postcss/lib/lazy-result.js:339:16)
    at LazyResult.runAsync (node_modules/postcss/lib/lazy-result.js:393:26)
    at LazyResult.async (node_modules/postcss/lib/lazy-result.js:221:30)
    at LazyResult.then (node_modules/postcss/lib/lazy-result.js:206:17)

Here's my task:

gulp.task("styles", function () {
  const stylesPath = PATH.assets + PATH.styles;
  return gulp
    .src(PATH.source + stylesPath + '**/*.scss') // source
    .pipe(
      plumber({
        errorHandler: onError,
      })
    )
    .pipe(changed(PATH.source + stylesPath + '**/*.scss')) // source
    .pipe(sourcemaps.init())
    .pipe(sassGlob())
    .pipe(sass({
        includePaths: ['node_modules'],
        errLogToConsole: true,
        outputStyle: "compressed",
      }).on('error', sass.logError))
    .pipe(postcss())
    .pipe(sourcemaps.write(PATH.maps))
    .pipe(gulp.dest(PATH.build + stylesPath)) // output
    .pipe(browser.stream());
});

I checked #179, which seems to be a similar problem, except that the workaround proposed is not viable in my case. There has to be a better way to fix this.

asertym avatar Aug 20 '22 21:08 asertym