Skip to content

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

@asertym

Description

@asertym

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions